Skip to content

Commit

Permalink
Use ??= over testing for null.
Browse files Browse the repository at this point in the history
  • Loading branch information
b-luk committed Feb 1, 2022
1 parent bc224ce commit b0765ac
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/web_ui/lib/src/engine/canvaskit/surface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ class Surface {
/// Creates a <canvas> and SkSurface for the given [size].
CkSurface createOrUpdateSurface(ui.Size size) {
if (useH5vccCanvasKit) {
if (_surface == null) {
_surface = CkSurface(canvasKit.getH5vccSkSurface(), null);
}
_surface ??= CkSurface(canvasKit.getH5vccSkSurface(), null);
return _surface!;
}

Expand Down

0 comments on commit b0765ac

Please sign in to comment.