diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h b/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h index c5846658ffb6..24fc39430fa5 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h +++ b/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h @@ -179,9 +179,8 @@ class StyleValuePool { static constexpr bool isIntegerPackable(float f) { constexpr uint16_t kMaxInlineAbsValue = (1 << 11) - 1; - auto i = static_cast(f); - return static_cast(i) == f && i >= -kMaxInlineAbsValue && - i <= +kMaxInlineAbsValue; + return f >= -kMaxInlineAbsValue && f <= +kMaxInlineAbsValue && + static_cast(static_cast(f)) == f; } static constexpr uint16_t packInlineInteger(float value) {