Unverified Commit 1a79592b authored by Ferhat's avatar Ferhat Committed by GitHub

Reduce closure allocation in RenderObject.cleanRelayoutBoundary (#51439)

parent 2132a0c7
...@@ -1584,12 +1584,15 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1584,12 +1584,15 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
if (_relayoutBoundary != this) { if (_relayoutBoundary != this) {
_relayoutBoundary = null; _relayoutBoundary = null;
_needsLayout = true; _needsLayout = true;
visitChildren((RenderObject child) { visitChildren(_cleanChildRelayoutBoundary);
child._cleanRelayoutBoundary();
});
} }
} }
// Reduces closure allocation for visitChildren use cases.
static void _cleanChildRelayoutBoundary(RenderObject child) {
child._cleanRelayoutBoundary();
}
/// Bootstrap the rendering pipeline by scheduling the very first layout. /// Bootstrap the rendering pipeline by scheduling the very first layout.
/// ///
/// Requires this render object to be attached and that this render object /// Requires this render object to be attached and that this render object
...@@ -1724,9 +1727,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1724,9 +1727,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
// The local relayout boundary has changed, must notify children in case // The local relayout boundary has changed, must notify children in case
// they also need updating. Otherwise, they will be confused about what // they also need updating. Otherwise, they will be confused about what
// their actual relayout boundary is later. // their actual relayout boundary is later.
visitChildren((RenderObject child) { visitChildren(_cleanChildRelayoutBoundary);
child._cleanRelayoutBoundary();
});
} }
_relayoutBoundary = relayoutBoundary; _relayoutBoundary = relayoutBoundary;
assert(!_debugMutationsLocked); assert(!_debugMutationsLocked);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment