diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 94a1e550..35d00b96 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -425,9 +425,7 @@ static void YGRemoveAllChildren(const YGNodeRef node) return; } - while (YGNodeGetChildCount(node) > 0) { - YGNodeRemoveChild(node, YGNodeGetChild(node, YGNodeGetChildCount(node) - 1)); - } + YGNodeRemoveAllChildren(node); } static CGFloat YGRoundPixelValue(CGFloat value)