From 4c11b55053011916b0e5babe5f460b54687b4eee Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 8 Aug 2019 00:20:48 -0700 Subject: [PATCH] Don't copy children in YGNodeComputeFlexBasisForChildren (#919) Summary: No need for a copy here. Pull Request resolved: https://github.com/facebook/yoga/pull/919 Differential Revision: D16701461 Pulled By: davidaurelio fbshipit-source-id: 3a90adbb2b5c43d5aefe693a8525aa3a37e53b3d --- ReactCommon/yoga/yoga/Yoga.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 73fb740ed9..34629e91a7 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1850,7 +1850,7 @@ static float YGNodeComputeFlexBasisForChildren( const uint32_t generationCount) { float totalOuterFlexBasis = 0.0f; YGNodeRef singleFlexChild = nullptr; - YGVector children = node->getChildren(); + const YGVector &children = node->getChildren(); YGMeasureMode measureModeMainDim = YGFlexDirectionIsRow(mainAxis) ? widthMeasureMode : heightMeasureMode; // If there is only one child with flexGrow + flexShrink it means we can set