diff --git a/ReactCommon/yoga/yoga/Utils.cpp b/ReactCommon/yoga/yoga/Utils.cpp index 1d8eb71e8..88ebd841b 100644 --- a/ReactCommon/yoga/yoga/Utils.cpp +++ b/ReactCommon/yoga/yoga/Utils.cpp @@ -55,13 +55,13 @@ float YGFloatSanitize(const float val) { return yoga::isUndefined(val) ? 0 : val; } -float YGUnwrapFloatOptional(const YGFloatOptional& op) { +float YGUnwrapFloatOptional(const YGFloatOptional op) { return op.unwrap(); } YGFloatOptional YGFloatOptionalMax( - const YGFloatOptional& op1, - const YGFloatOptional& op2) { + const YGFloatOptional op1, + const YGFloatOptional op2) { if (op1 > op2) { return op1; } diff --git a/ReactCommon/yoga/yoga/Utils.h b/ReactCommon/yoga/yoga/Utils.h index d007ff546..204b2718b 100644 --- a/ReactCommon/yoga/yoga/Utils.h +++ b/ReactCommon/yoga/yoga/Utils.h @@ -60,8 +60,8 @@ bool YGFloatsEqual(const float a, const float b); float YGFloatMax(const float a, const float b); YGFloatOptional YGFloatOptionalMax( - const YGFloatOptional& op1, - const YGFloatOptional& op2); + const YGFloatOptional op1, + const YGFloatOptional op2); float YGFloatMin(const float a, const float b); @@ -85,7 +85,7 @@ float YGFloatSanitize(const float val); // This function unwraps optional and returns YGUndefined if not defined or // op.value otherwise // TODO: Get rid off this function -float YGUnwrapFloatOptional(const YGFloatOptional& op); +float YGUnwrapFloatOptional(const YGFloatOptional op); YGFlexDirection YGFlexDirectionCross( const YGFlexDirection flexDirection, diff --git a/ReactCommon/yoga/yoga/YGNode.cpp b/ReactCommon/yoga/yoga/YGNode.cpp index 558a89373..83c1eabd1 100644 --- a/ReactCommon/yoga/yoga/YGNode.cpp +++ b/ReactCommon/yoga/yoga/YGNode.cpp @@ -175,7 +175,7 @@ void YGNode::setLayoutLastOwnerDirection(YGDirection direction) { } void YGNode::setLayoutComputedFlexBasis( - const YGFloatOptional& computedFlexBasis) { + const YGFloatOptional computedFlexBasis) { layout_.computedFlexBasis = computedFlexBasis; } @@ -445,7 +445,7 @@ float YGNode::getTrailingBorder(const YGFlexDirection flexDirection) const { YGFloatOptional YGNode::getLeadingPadding( const YGFlexDirection axis, const float widthSize) const { - const YGFloatOptional& paddingEdgeStart = + const YGFloatOptional paddingEdgeStart = YGResolveValue(style_.padding[YGEdgeStart], widthSize); if (YGFlexDirectionIsRow(axis) && paddingEdgeStart >= YGFloatOptional{0.0f}) { return paddingEdgeStart; @@ -460,7 +460,7 @@ YGFloatOptional YGNode::getLeadingPadding( YGFloatOptional YGNode::getTrailingPadding( const YGFlexDirection axis, const float widthSize) const { - const YGFloatOptional& paddingEdgeEnd = + const YGFloatOptional paddingEdgeEnd = YGResolveValue(style_.padding[YGEdgeEnd], widthSize); if (YGFlexDirectionIsRow(axis) && paddingEdgeEnd >= YGFloatOptional{0.0f}) { return paddingEdgeEnd; diff --git a/ReactCommon/yoga/yoga/YGNode.h b/ReactCommon/yoga/yoga/YGNode.h index 719eb2ea9..573128128 100644 --- a/ReactCommon/yoga/yoga/YGNode.h +++ b/ReactCommon/yoga/yoga/YGNode.h @@ -235,7 +235,7 @@ struct YGNode { void setDirty(bool isDirty); void setLayoutLastOwnerDirection(YGDirection direction); - void setLayoutComputedFlexBasis(const YGFloatOptional& computedFlexBasis); + void setLayoutComputedFlexBasis(const YGFloatOptional computedFlexBasis); void setLayoutComputedFlexBasisGeneration( uint32_t computedFlexBasisGeneration); void setLayoutMeasuredDimension(float measuredDimension, int index); diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 5197d9948..e708f61c9 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1323,14 +1323,14 @@ static void YGNodeComputeFlexBasisForChild( child->getConfig(), YGExperimentalFeatureWebFlexBasis) && child->getLayout().computedFlexBasisGeneration != gCurrentGenerationCount)) { - const YGFloatOptional& paddingAndBorder = YGFloatOptional( + const YGFloatOptional paddingAndBorder = YGFloatOptional( YGNodePaddingAndBorderForAxis(child, mainAxis, ownerWidth)); child->setLayoutComputedFlexBasis( YGFloatOptionalMax(resolvedFlexBasis, paddingAndBorder)); } } else if (isMainAxisRow && isRowStyleDimDefined) { // The width is definite, so use that as the flex basis. - const YGFloatOptional& paddingAndBorder = YGFloatOptional( + const YGFloatOptional paddingAndBorder = YGFloatOptional( YGNodePaddingAndBorderForAxis(child, YGFlexDirectionRow, ownerWidth)); child->setLayoutComputedFlexBasis(YGFloatOptionalMax( @@ -1339,7 +1339,7 @@ static void YGNodeComputeFlexBasisForChild( paddingAndBorder)); } else if (!isMainAxisRow && isColumnStyleDimDefined) { // The height is definite, so use that as the flex basis. - const YGFloatOptional& paddingAndBorder = + const YGFloatOptional paddingAndBorder = YGFloatOptional(YGNodePaddingAndBorderForAxis( child, YGFlexDirectionColumn, ownerWidth)); child->setLayoutComputedFlexBasis(YGFloatOptionalMax(