From 48584547180cf97177132eed8fcad390b12a2677 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Wed, 11 Jul 2018 08:51:31 -0700 Subject: [PATCH] Remove unused YGNode::*nextChild Summary: This linked list was never used, and YGNodeDeepClone was doing scary things to maintain it. Reviewed By: davidaurelio Differential Revision: D8792864 fbshipit-source-id: c578fabe65c837f0791aa9ac3e18f31d93691abd --- ReactCommon/yoga/yoga/YGNode.cpp | 13 ------------- ReactCommon/yoga/yoga/YGNode.h | 4 ---- ReactCommon/yoga/yoga/Yoga.cpp | 4 ---- 3 files changed, 21 deletions(-) diff --git a/ReactCommon/yoga/yoga/YGNode.cpp b/ReactCommon/yoga/yoga/YGNode.cpp index 16f9e4d00..67d991a4a 100644 --- a/ReactCommon/yoga/yoga/YGNode.cpp +++ b/ReactCommon/yoga/yoga/YGNode.cpp @@ -69,10 +69,6 @@ YGNodeRef YGNode::getChild(uint32_t index) const { return children_.at(index); } -YGNodeRef YGNode::getNextChild() const { - return nextChild_; -} - YGConfigRef YGNode::getConfig() const { return config_; } @@ -249,10 +245,6 @@ void YGNode::setChildren(const YGVector& children) { children_ = children; } -void YGNode::setNextChild(YGNodeRef nextChild) { - nextChild_ = nextChild; -} - void YGNode::replaceChild(YGNodeRef child, uint32_t index) { children_[index] = child; } @@ -405,7 +397,6 @@ YGNode::YGNode() lineIndex_(0), owner_(nullptr), children_(YGVector()), - nextChild_(nullptr), config_(nullptr), isDirty_(false), resolvedDimensions_({{YGValueUndefined, YGValueUndefined}}) {} @@ -423,7 +414,6 @@ YGNode::YGNode(const YGNode& node) lineIndex_(node.lineIndex_), owner_(node.owner_), children_(node.children_), - nextChild_(node.nextChild_), config_(node.config_), isDirty_(node.isDirty_), resolvedDimensions_(node.resolvedDimensions_) {} @@ -445,7 +435,6 @@ YGNode::YGNode( uint32_t lineIndex, YGNodeRef owner, const YGVector& children, - YGNodeRef nextChild, YGConfigRef config, bool isDirty, std::array resolvedDimensions) @@ -461,7 +450,6 @@ YGNode::YGNode( lineIndex_(lineIndex), owner_(owner), children_(children), - nextChild_(nextChild), config_(config), isDirty_(isDirty), resolvedDimensions_(resolvedDimensions) {} @@ -487,7 +475,6 @@ YGNode& YGNode::operator=(const YGNode& node) { lineIndex_ = node.getLineIndex(); owner_ = node.getOwner(); children_ = node.getChildren(); - nextChild_ = node.getNextChild(); config_ = node.getConfig(); isDirty_ = node.isDirty(); resolvedDimensions_ = node.getResolvedDimensions(); diff --git a/ReactCommon/yoga/yoga/YGNode.h b/ReactCommon/yoga/yoga/YGNode.h index e3562bb60..e4d50dcf8 100644 --- a/ReactCommon/yoga/yoga/YGNode.h +++ b/ReactCommon/yoga/yoga/YGNode.h @@ -26,7 +26,6 @@ struct YGNode { uint32_t lineIndex_; YGNodeRef owner_; YGVector children_; - YGNodeRef nextChild_; YGConfigRef config_; bool isDirty_; std::array resolvedDimensions_; @@ -54,7 +53,6 @@ struct YGNode { uint32_t lineIndex, YGNodeRef owner, const YGVector& children, - YGNodeRef nextChild, YGConfigRef config, bool isDirty, std::array resolvedDimensions); @@ -83,7 +81,6 @@ struct YGNode { YGVector getChildren() const; uint32_t getChildrenCount() const; YGNodeRef getChild(uint32_t index) const; - YGNodeRef getNextChild() const; YGConfigRef getConfig() const; bool isDirty() const; std::array getResolvedDimensions() const; @@ -136,7 +133,6 @@ struct YGNode { void setLineIndex(uint32_t lineIndex); void setOwner(YGNodeRef owner); void setChildren(const YGVector& children); - void setNextChild(YGNodeRef nextChild); void setConfig(YGConfigRef config); void setDirty(bool isDirty); void setLayoutLastOwnerDirection(YGDirection direction); diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 3684aae4f..5b5a90888 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -275,10 +275,6 @@ static YGNodeRef YGNodeDeepClone(YGNodeRef oldNode) { node->setConfig(YGConfigClone(*(oldNode->getConfig()))); } - if (oldNode->getNextChild() != nullptr) { - node->setNextChild(YGNodeDeepClone(oldNode->getNextChild())); - } - return node; }