Skip to content

Commit

Permalink
YGNodeChildCount -> YGNodeGetChildCount for consistency
Browse files Browse the repository at this point in the history
Reviewed By: gkassabli

Differential Revision: D4333480

fbshipit-source-id: 17058f18fa9e26b3e02f7a1651f7295cae59acad
  • Loading branch information
Emil Sjolander authored and facebook-github-bot committed Dec 16, 2016
1 parent c0ea23c commit 45fdcdc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions React/CSSLayout/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void YGNodeFree(const YGNodeRef node) {
node->parent = NULL;
}

const uint32_t childCount = YGNodeChildCount(node);
const uint32_t childCount = YGNodeGetChildCount(node);
for (uint32_t i = 0; i < childCount; i++) {
const YGNodeRef child = YGNodeGetChild(node, i);
child->parent = NULL;
Expand All @@ -214,7 +214,7 @@ void YGNodeFree(const YGNodeRef node) {
}

void YGNodeFreeRecursive(const YGNodeRef root) {
while (YGNodeChildCount(root) > 0) {
while (YGNodeGetChildCount(root) > 0) {
const YGNodeRef child = YGNodeGetChild(root, 0);
YGNodeRemoveChild(root, child);
YGNodeFreeRecursive(child);
Expand All @@ -223,7 +223,7 @@ void YGNodeFreeRecursive(const YGNodeRef root) {
}

void YGNodeReset(const YGNodeRef node) {
YG_ASSERT(YGNodeChildCount(node) == 0, "Cannot reset a node which still has children attached");
YG_ASSERT(YGNodeGetChildCount(node) == 0, "Cannot reset a node which still has children attached");
YG_ASSERT(node->parent == NULL, "Cannot reset a node still attached to a parent");

YGNodeListFree(node->children);
Expand Down Expand Up @@ -303,7 +303,7 @@ void YGNodeSetMeasureFunc(const YGNodeRef node, YGMeasureFunc measureFunc) {
if (measureFunc == NULL) {
node->measure = NULL;
} else {
YG_ASSERT(YGNodeChildCount(node) == 0,
YG_ASSERT(YGNodeGetChildCount(node) == 0,
"Cannot set measure function: Nodes with measure functions cannot have children.");
node->measure = measureFunc;
}
Expand Down Expand Up @@ -333,7 +333,7 @@ YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index) {
return YGNodeListGet(node->children, index);
}

inline uint32_t YGNodeChildCount(const YGNodeRef node) {
inline uint32_t YGNodeGetChildCount(const YGNodeRef node) {
return YGNodeListCount(node->children);
}

Expand Down
2 changes: 1 addition & 1 deletion React/CSSLayout/Yoga.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ WIN_EXPORT void YGNodeInsertChild(const YGNodeRef node,
const uint32_t index);
WIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child);
WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index);
WIN_EXPORT uint32_t YGNodeChildCount(const YGNodeRef node);
WIN_EXPORT uint32_t YGNodeGetChildCount(const YGNodeRef node);

WIN_EXPORT void YGNodeCalculateLayout(const YGNodeRef node,
const float availableWidth,
Expand Down
2 changes: 1 addition & 1 deletion React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ - (void)applyLayoutToChildren:(YGNodeRef)node
viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame
absolutePosition:(CGPoint)absolutePosition
{
for (unsigned int i = 0; i < YGNodeChildCount(node); ++i) {
for (unsigned int i = 0; i < YGNodeGetChildCount(node); ++i) {
RCTShadowView *child = (RCTShadowView *)_reactSubviews[i];
[child applyLayoutNode:YGNodeGetChild(node, i)
viewsWithNewFrame:viewsWithNewFrame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static void YGTransferLayoutOutputsRecursive(YGNodeRef root) {
obj->setFieldValue(topField, YGNodeLayoutGetTop(root));
YGTransferLayoutDirection(root, obj);

for (uint32_t i = 0; i < YGNodeChildCount(root); i++) {
for (uint32_t i = 0; i < YGNodeGetChildCount(root); i++) {
YGTransferLayoutOutputsRecursive(YGNodeGetChild(root, i));
}
} else {
Expand Down
10 changes: 5 additions & 5 deletions ReactCommon/yoga/yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void YGNodeFree(const YGNodeRef node) {
node->parent = NULL;
}

const uint32_t childCount = YGNodeChildCount(node);
const uint32_t childCount = YGNodeGetChildCount(node);
for (uint32_t i = 0; i < childCount; i++) {
const YGNodeRef child = YGNodeGetChild(node, i);
child->parent = NULL;
Expand All @@ -268,7 +268,7 @@ void YGNodeFree(const YGNodeRef node) {
}

void YGNodeFreeRecursive(const YGNodeRef root) {
while (YGNodeChildCount(root) > 0) {
while (YGNodeGetChildCount(root) > 0) {
const YGNodeRef child = YGNodeGetChild(root, 0);
YGNodeRemoveChild(root, child);
YGNodeFreeRecursive(child);
Expand All @@ -277,7 +277,7 @@ void YGNodeFreeRecursive(const YGNodeRef root) {
}

void YGNodeReset(const YGNodeRef node) {
YG_ASSERT(YGNodeChildCount(node) == 0, "Cannot reset a node which still has children attached");
YG_ASSERT(YGNodeGetChildCount(node) == 0, "Cannot reset a node which still has children attached");
YG_ASSERT(node->parent == NULL, "Cannot reset a node still attached to a parent");

YGNodeListFree(node->children);
Expand All @@ -303,7 +303,7 @@ void YGNodeSetMeasureFunc(const YGNodeRef node, YGMeasureFunc measureFunc) {
if (measureFunc == NULL) {
node->measure = NULL;
} else {
YG_ASSERT(YGNodeChildCount(node) == 0,
YG_ASSERT(YGNodeGetChildCount(node) == 0,
"Cannot set measure function: Nodes with measure functions cannot have children.");
node->measure = measureFunc;
}
Expand Down Expand Up @@ -337,7 +337,7 @@ YGNodeRef YGNodeGetParent(const YGNodeRef node) {
return node->parent;
}

inline uint32_t YGNodeChildCount(const YGNodeRef node) {
inline uint32_t YGNodeGetChildCount(const YGNodeRef node) {
return YGNodeListCount(node->children);
}

Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/yoga/yoga/Yoga.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ WIN_EXPORT void YGNodeInsertChild(const YGNodeRef node,
WIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child);
WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index);
WIN_EXPORT YGNodeRef YGNodeGetParent(const YGNodeRef node);
WIN_EXPORT uint32_t YGNodeChildCount(const YGNodeRef node);
WIN_EXPORT uint32_t YGNodeGetChildCount(const YGNodeRef node);

WIN_EXPORT void YGNodeCalculateLayout(const YGNodeRef node,
const float availableWidth,
Expand Down

0 comments on commit 45fdcdc

Please sign in to comment.