Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b0765ac

Browse files
committed
Use ??= over testing for null.
1 parent bc224ce commit b0765ac

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/web_ui/lib/src/engine/canvaskit/surface.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,7 @@ class Surface {
138138
/// Creates a <canvas> and SkSurface for the given [size].
139139
CkSurface createOrUpdateSurface(ui.Size size) {
140140
if (useH5vccCanvasKit) {
141-
if (_surface == null) {
142-
_surface = CkSurface(canvasKit.getH5vccSkSurface(), null);
143-
}
141+
_surface ??= CkSurface(canvasKit.getH5vccSkSurface(), null);
144142
return _surface!;
145143
}
146144

0 commit comments

Comments
 (0)