From b13d5beb11ee633509896c1d432be23f7da76117 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 10 Apr 2018 16:37:22 -0700 Subject: [PATCH] Fabric: `LayoutableShadowNodeList::getChildren` renamed to `getLayoutableChildNodes` Summary: The previous name conflicts with the method with same (but with different semantic) name in `ShadowNode` class. That was bad idea to use same name especially because the different semantic. Reviewed By: fkgozali Differential Revision: D7554549 fbshipit-source-id: 0bccbaacd0812f8a26592b2008f15ddb5bc34ebc --- ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp | 2 +- ReactCommon/fabric/core/layout/LayoutableShadowNode.h | 2 +- ReactCommon/fabric/view/ViewShadowNode.cpp | 2 +- ReactCommon/fabric/view/ViewShadowNode.h | 2 +- ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp index b6f9923fd..3e2b4a0e8 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp @@ -64,7 +64,7 @@ Float LayoutableShadowNode::lastBaseline(Size size) const { void LayoutableShadowNode::layout(LayoutContext layoutContext) { layoutChildren(layoutContext); - for (auto child : getChildren()) { + for (auto child : getLayoutableChildNodes()) { if (!child->getHasNewLayout()) { continue; } diff --git a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h index e3176f1f3..d1c9ce1d6 100644 --- a/ReactCommon/fabric/core/layout/LayoutableShadowNode.h +++ b/ReactCommon/fabric/core/layout/LayoutableShadowNode.h @@ -88,7 +88,7 @@ protected: /* * Returns layoutable children to interate on. */ - virtual SharedLayoutableShadowNodeList getChildren() const = 0; + virtual SharedLayoutableShadowNodeList getLayoutableChildNodes() const = 0; /* * In case layout algorithm needs to mutate this (probably sealed) node, diff --git a/ReactCommon/fabric/view/ViewShadowNode.cpp b/ReactCommon/fabric/view/ViewShadowNode.cpp index a51f151b9..111d220ec 100644 --- a/ReactCommon/fabric/view/ViewShadowNode.cpp +++ b/ReactCommon/fabric/view/ViewShadowNode.cpp @@ -75,7 +75,7 @@ void ViewShadowNode::appendChild(const SharedShadowNode &child) { #pragma mark - YogaLayoutableShadowNode -SharedLayoutableShadowNodeList ViewShadowNode::getChildren() const { +SharedLayoutableShadowNodeList ViewShadowNode::getLayoutableChildNodes() const { SharedLayoutableShadowNodeList sharedLayoutableShadowNodeList = {}; for (auto child : *children_) { const SharedLayoutableShadowNode layoutableShadowNode = std::dynamic_pointer_cast(child); diff --git a/ReactCommon/fabric/view/ViewShadowNode.h b/ReactCommon/fabric/view/ViewShadowNode.h index b80a138fd..230aad569 100644 --- a/ReactCommon/fabric/view/ViewShadowNode.h +++ b/ReactCommon/fabric/view/ViewShadowNode.h @@ -60,7 +60,7 @@ private: #pragma mark - LayoutableShadowNode - SharedLayoutableShadowNodeList getChildren() const override; + SharedLayoutableShadowNodeList getLayoutableChildNodes() const override; SharedLayoutableShadowNode cloneAndReplaceChild(const SharedLayoutableShadowNode &child) override; }; diff --git a/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp index 62c803b2f..2851fa4d9 100644 --- a/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp @@ -114,7 +114,7 @@ void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) { } void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) { - for (auto child : getChildren()) { + for (auto child : getLayoutableChildNodes()) { auto yogaLayoutableChild = std::dynamic_pointer_cast(child); if (!yogaLayoutableChild) { continue; @@ -183,7 +183,7 @@ YGNode *YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector(YGNode *oldYoga // * Create a new `shared_ptr` with empty deleter. // * Using `childIndex` to find exact node. SharedLayoutableShadowNode oldShadowNode = nullptr; - for (auto child : parentShadowNodeRawPtr->getChildren()) { + for (auto child : parentShadowNodeRawPtr->getLayoutableChildNodes()) { if (child.get() == oldShadowNodeRawPtr) { oldShadowNode = child; break;