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 2562c029b1
commit 910aa77c01

View File

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