Zero out all fields in YGZeroOutLayoutRecursivly using memset

Reviewed By: emilsjolander

Differential Revision: D5842351

fbshipit-source-id: d2c2b6f829588a200525b7ccbdb63003cb4dcc4e
This commit is contained in:
Mingwei Pan 2017-09-15 08:22:36 -07:00 committed by Facebook Github Bot
parent cf2ef84b16
commit d0f36d7a68

View File

@ -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++) {