Permalink
Browse files

Zero out all fields in YGZeroOutLayoutRecursivly using memset

Reviewed By: emilsjolander

Differential Revision: D5842351

fbshipit-source-id: d2c2b6f829588a200525b7ccbdb63003cb4dcc4e
  • Loading branch information...
Mingwei Pan authored and facebook-github-bot committed Sep 15, 2017
1 parent cf2ef84 commit d0f36d7a68b0aa9b71d8bc1127328de3e58160db
Showing with 1 addition and 12 deletions.
  1. +1 −12 ReactCommon/yoga/yoga/Yoga.c
@@ -1865,18 +1865,7 @@ static bool YGNodeFixedSizeSetMeasuredDimensions(const YGNodeRef node,
}
static void YGZeroOutLayoutRecursivly(const YGNodeRef node) {
node->layout.dimensions[YGDimensionHeight] = 0;
node->layout.dimensions[YGDimensionWidth] = 0;
node->layout.position[YGEdgeTop] = 0;
node->layout.position[YGEdgeBottom] = 0;
node->layout.position[YGEdgeLeft] = 0;
node->layout.position[YGEdgeRight] = 0;
node->layout.cachedLayout.availableHeight = 0;
node->layout.cachedLayout.availableWidth = 0;
node->layout.cachedLayout.heightMeasureMode = YGMeasureModeExactly;
node->layout.cachedLayout.widthMeasureMode = YGMeasureModeExactly;
node->layout.cachedLayout.computedWidth = 0;
node->layout.cachedLayout.computedHeight = 0;
memset(&(node->layout), 0, sizeof(YGLayout));
node->hasNewLayout = true;
const uint32_t childCount = YGNodeGetChildCount(node);
for (uint32_t i = 0; i < childCount; i++) {

0 comments on commit d0f36d7

Please sign in to comment.