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
This commit is contained in:
parent
c4bd7cef69
commit
53837c4a4f
|
@ -105,9 +105,8 @@ void YogaLayoutableShadowNode::appendChild(SharedYogaLayoutableShadowNode child)
|
|||
}
|
||||
|
||||
void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) {
|
||||
ensureUnsealed();
|
||||
|
||||
if (!getIsLayoutClean()) {
|
||||
ensureUnsealed();
|
||||
YGNode *yogaNode = const_cast<YGNode *>(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<const YogaLayoutableShadowNode>(child);
|
||||
if (!yogaLayoutableChild) {
|
||||
|
|
Loading…
Reference in New Issue