Remove some unnecessary `const float &` uses

Summary: Holding floats by reference is unnecessary at best and may be detrimental to performance.

Reviewed By: davidaurelio

Differential Revision: D8826496

fbshipit-source-id: 2391f8aa26ebfbb440f6e4b7d57975be688f791c
This commit is contained in:
Scott Wolchok 2018-07-13 12:34:51 -07:00 committed by Facebook Github Bot
parent 727ee92de5
commit 6ab52ff90d
1 changed files with 6 additions and 6 deletions

View File

@ -1249,9 +1249,9 @@ static void YGNodeComputeFlexBasisForChild(const YGNodeRef node,
childWidthMeasureMode = YGMeasureModeUndefined;
childHeightMeasureMode = YGMeasureModeUndefined;
const float& marginRow = YGUnwrapFloatOptional(
auto marginRow = YGUnwrapFloatOptional(
child->getMarginForAxis(YGFlexDirectionRow, ownerWidth));
const float& marginColumn = YGUnwrapFloatOptional(
auto marginColumn = YGUnwrapFloatOptional(
child->getMarginForAxis(YGFlexDirectionColumn, ownerWidth));
if (isRowStyleDimDefined) {
@ -1377,9 +1377,9 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
YGMeasureMode childWidthMeasureMode = YGMeasureModeUndefined;
YGMeasureMode childHeightMeasureMode = YGMeasureModeUndefined;
const float& marginRow =
auto marginRow =
YGUnwrapFloatOptional(child->getMarginForAxis(YGFlexDirectionRow, width));
const float& marginColumn = YGUnwrapFloatOptional(
auto marginColumn = YGUnwrapFloatOptional(
child->getMarginForAxis(YGFlexDirectionColumn, width));
if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) {
@ -1679,9 +1679,9 @@ static bool YGNodeFixedSizeSetMeasuredDimensions(const YGNodeRef node,
heightMeasureMode == YGMeasureModeAtMost && availableHeight <= 0.0f) ||
(widthMeasureMode == YGMeasureModeExactly &&
heightMeasureMode == YGMeasureModeExactly)) {
const float& marginAxisColumn = YGUnwrapFloatOptional(
auto marginAxisColumn = YGUnwrapFloatOptional(
node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth));
const float& marginAxisRow = YGUnwrapFloatOptional(
auto marginAxisRow = YGUnwrapFloatOptional(
node->getMarginForAxis(YGFlexDirectionRow, ownerWidth));
node->setLayoutMeasuredDimension(