diff --git a/ReactCommon/fabric/components/view/conversions.h b/ReactCommon/fabric/components/view/conversions.h index 2edafb32223ada..19ab084f2736d3 100644 --- a/ReactCommon/fabric/components/view/conversions.h +++ b/ReactCommon/fabric/components/view/conversions.h @@ -583,12 +583,11 @@ inline std::string toString(const YGFloatOptional &value) { return folly::to(floatFromYogaFloat(value.unwrap())); } -inline std::string toString( - const std::array &value) { +inline std::string toString(const YGStyle::Dimensions &value) { return "{" + toString(value[0]) + ", " + toString(value[1]) + "}"; } -inline std::string toString(const std::array &value) { +inline std::string toString(const YGStyle::Edges &value) { static std::array names = {{"left", "top", "right", diff --git a/ReactCommon/fabric/components/view/propsConversions.h b/ReactCommon/fabric/components/view/propsConversions.h index cd18390caa0759..d52e431609ea21 100644 --- a/ReactCommon/fabric/components/view/propsConversions.h +++ b/ReactCommon/fabric/components/view/propsConversions.h @@ -13,32 +13,32 @@ namespace facebook { namespace react { -static inline std::array convertRawProp( +static inline YGStyle::Dimensions convertRawProp( const RawProps &rawProps, const std::string &widthName, const std::string &heightName, - const std::array &sourceValue, - const std::array &defaultValue) { - auto dimentions = defaultValue; - dimentions[YGDimensionWidth] = convertRawProp( + const YGStyle::Dimensions &sourceValue, + const YGStyle::Dimensions &defaultValue) { + auto dimensions = defaultValue; + dimensions[YGDimensionWidth] = convertRawProp( rawProps, widthName, sourceValue[YGDimensionWidth], defaultValue[YGDimensionWidth]); - dimentions[YGDimensionHeight] = convertRawProp( + dimensions[YGDimensionHeight] = convertRawProp( rawProps, heightName, sourceValue[YGDimensionHeight], defaultValue[YGDimensionWidth]); - return dimentions; + return dimensions; } -static inline std::array convertRawProp( +static inline YGStyle::Edges convertRawProp( const RawProps &rawProps, const std::string &prefix, const std::string &suffix, - const std::array &sourceValue, - const std::array &defaultValue) { + const YGStyle::Edges &sourceValue, + const YGStyle::Edges &defaultValue) { auto result = defaultValue; result[YGEdgeLeft] = convertRawProp( rawProps, @@ -88,10 +88,10 @@ static inline std::array convertRawProp( return result; } -static inline std::array convertRawProp( +static inline YGStyle::Edges convertRawProp( const RawProps &rawProps, - const std::array &sourceValue, - const std::array &defaultValue) { + const YGStyle::Edges &sourceValue, + const YGStyle::Edges &defaultValue) { auto result = defaultValue; result[YGEdgeLeft] = convertRawProp( rawProps, "left", sourceValue[YGEdgeLeft], defaultValue[YGEdgeLeft]); diff --git a/ReactCommon/yoga/yoga/YGNodePrint.cpp b/ReactCommon/yoga/yoga/YGNodePrint.cpp index 753a00b60a0ad7..03bff15ae8cd15 100644 --- a/ReactCommon/yoga/yoga/YGNodePrint.cpp +++ b/ReactCommon/yoga/yoga/YGNodePrint.cpp @@ -20,7 +20,8 @@ static void indent(string& base, uint32_t level) { } } -static bool areFourValuesEqual(const std::array& four) { +static bool areFourValuesEqual( + const facebook::yoga::detail::Values& four) { return YGValueEqual(four[0], four[1]) && YGValueEqual(four[0], four[2]) && YGValueEqual(four[0], four[3]); } @@ -81,7 +82,7 @@ appendNumberIfNotZero(string& base, const string& str, const YGValue number) { static void appendEdges( string& base, const string& key, - const std::array& edges) { + const facebook::yoga::detail::Values& edges) { if (areFourValuesEqual(edges)) { appendNumberIfNotZero(base, key, edges[YGEdgeLeft]); } else { @@ -95,7 +96,7 @@ static void appendEdges( static void appendEdgeIfNotUndefined( string& base, const string& str, - const std::array& edges, + const facebook::yoga::detail::Values& edges, const YGEdge edge) { appendNumberIfNotUndefined( base, str, *YGComputedEdgeValue(edges, edge, &YGValueUndefined)); diff --git a/ReactCommon/yoga/yoga/Yoga-internal.h b/ReactCommon/yoga/yoga/Yoga-internal.h index cc4da004850dae..719d7b375e167f 100644 --- a/ReactCommon/yoga/yoga/Yoga-internal.h +++ b/ReactCommon/yoga/yoga/Yoga-internal.h @@ -103,12 +103,6 @@ class Values { values_.fill(defaultValue); } - operator const std::array&() const noexcept { - return values_; - } - operator std::array&() noexcept { - return values_; - } const YGValue& operator[](size_t i) const noexcept { return values_[i]; } @@ -136,10 +130,6 @@ class Values { } Values& operator=(const Values& other) = default; - Values& operator=(const std::array& other) noexcept { - values_ = other; - return *this; - } }; } // namespace detail @@ -153,6 +143,6 @@ static const float kWebDefaultFlexShrink = 1.0f; extern bool YGFloatsEqual(const float a, const float b); extern bool YGValueEqual(const YGValue a, const YGValue b); extern const YGValue* YGComputedEdgeValue( - const std::array& edges, + const facebook::yoga::detail::Values& edges, const YGEdge edge, const YGValue* const defaultValue); diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 4a1a98a252ea9d..beb01c599848d3 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -103,7 +103,7 @@ bool YGFloatIsUndefined(const float value) { } const YGValue* YGComputedEdgeValue( - const std::array& edges, + const facebook::yoga::detail::Values& edges, const YGEdge edge, const YGValue* const defaultValue) { if (edges[edge].unit != YGUnitUndefined) {