From 910aa77c0189bce6cc7d45875aeb7c080407171d Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Fri, 13 Jul 2018 12:34:51 -0700 Subject: [PATCH] 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 --- yoga/Yoga.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index df186c7c..1ea109e2 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -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(