Skip to content

Commit

Permalink
Move _isSubtreeDirty visitor below
Browse files Browse the repository at this point in the history
  • Loading branch information
knopp committed Apr 24, 2024
1 parent 8f66646 commit 47cdad4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions super_editor/lib/src/infrastructure/content_layers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ class ContentLayersElement extends RenderObjectElement {

static bool _isDirty = false;

// This is intentionally static to prevent closure allocation during
bool _isSubtreeDirty(Element element) {
_isDirty = false;
element.visitChildren(_isSubtreeDirtyVisitor);
return _isDirty;
}

// This is intentionally static to prevent closure allocation during
// the traversal of the element tree.
static void _isSubtreeDirtyVisitor(Element element) {
// Can't use the () => message syntax because it allocates a closure.
Expand All @@ -247,12 +253,6 @@ class ContentLayersElement extends RenderObjectElement {
element.visitChildren(_isSubtreeDirtyVisitor);
}

bool _isSubtreeDirty(Element element) {
_isDirty = false;
element.visitChildren(_isSubtreeDirtyVisitor);
return _isDirty;
}

void _onContentBuildScheduled() {
_temporarilyForgetLayers();
}
Expand Down

0 comments on commit 47cdad4

Please sign in to comment.