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:
Valentin Shergin 2018-04-10 12:46:09 -07:00 committed by Facebook Github Bot
parent c4bd7cef69
commit 53837c4a4f
1 changed files with 1 additions and 4 deletions

View File

@ -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) {