From 53837c4a4f9e689eb2f435564afede5f3466b84e Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 10 Apr 2018 12:46:09 -0700 Subject: [PATCH] Fabric: Refined usage of `ensureunSealed` in `YogaLayoutableShadowNode::layout()` Summary: We have to call `ensureunSealed()` only if the node was changed. Reviewed By: mdvacca Differential Revision: D7503388 fbshipit-source-id: a3d07d50fa983ef93c14fa771711fa783fdf4c12 --- ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp index 71e5ac89b34..e2aa05f843a 100644 --- a/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp @@ -105,9 +105,8 @@ void YogaLayoutableShadowNode::appendChild(SharedYogaLayoutableShadowNode child) } void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) { - ensureUnsealed(); - if (!getIsLayoutClean()) { + ensureUnsealed(); YGNode *yogaNode = const_cast(yogaNode_.get()); YGNodeCalculateLayout(yogaNode, YGUndefined, YGUndefined, YGDirectionInherit); } @@ -116,8 +115,6 @@ void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) { } void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { - ensureUnsealed(); - for (auto child : getChildren()) { auto yogaLayoutableChild = std::dynamic_pointer_cast(child); if (!yogaLayoutableChild) {