Skip to content

Commit

Permalink
Remove unused YGNode::*nextChild
Browse files Browse the repository at this point in the history
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
  • Loading branch information
swolchok authored and facebook-github-bot committed Jul 11, 2018
1 parent 00936a0 commit 4858454
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
13 changes: 0 additions & 13 deletions ReactCommon/yoga/yoga/YGNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -405,7 +397,6 @@ YGNode::YGNode()
lineIndex_(0),
owner_(nullptr),
children_(YGVector()),
nextChild_(nullptr),
config_(nullptr),
isDirty_(false),
resolvedDimensions_({{YGValueUndefined, YGValueUndefined}}) {}
Expand All @@ -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_) {}
Expand All @@ -445,7 +435,6 @@ YGNode::YGNode(
uint32_t lineIndex,
YGNodeRef owner,
const YGVector& children,
YGNodeRef nextChild,
YGConfigRef config,
bool isDirty,
std::array<YGValue, 2> resolvedDimensions)
Expand All @@ -461,7 +450,6 @@ YGNode::YGNode(
lineIndex_(lineIndex),
owner_(owner),
children_(children),
nextChild_(nextChild),
config_(config),
isDirty_(isDirty),
resolvedDimensions_(resolvedDimensions) {}
Expand All @@ -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();
Expand Down
4 changes: 0 additions & 4 deletions ReactCommon/yoga/yoga/YGNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ struct YGNode {
uint32_t lineIndex_;
YGNodeRef owner_;
YGVector children_;
YGNodeRef nextChild_;
YGConfigRef config_;
bool isDirty_;
std::array<YGValue, 2> resolvedDimensions_;
Expand Down Expand Up @@ -54,7 +53,6 @@ struct YGNode {
uint32_t lineIndex,
YGNodeRef owner,
const YGVector& children,
YGNodeRef nextChild,
YGConfigRef config,
bool isDirty,
std::array<YGValue, 2> resolvedDimensions);
Expand Down Expand Up @@ -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<YGValue, 2> getResolvedDimensions() const;
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4858454

Please sign in to comment.