From 4884d9a167cfec20f30147bea3bd82b7a06a85b7 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 9 Nov 2023 19:10:23 -0800 Subject: [PATCH] Simplify `YGConfigSetPointScaleFactor` (#1451) Summary: X-link: https://github.com/facebook/react-native/pull/41327 The special meaning of `0.0` is now explained in the function header, and we aren't doing any sort of insensitive compare here, so the code after should be equivalent and a bit simpler. Reviewed By: yungsters Differential Revision: D51014264 --- yoga/YGConfig.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/yoga/YGConfig.cpp b/yoga/YGConfig.cpp index 2cdc7af995..970a740e52 100644 --- a/yoga/YGConfig.cpp +++ b/yoga/YGConfig.cpp @@ -40,13 +40,7 @@ void YGConfigSetPointScaleFactor( pixelsInPoint >= 0.0f, "Scale factor should not be less than zero"); - // We store points for Pixel as we will use it for rounding - if (pixelsInPoint == 0.0f) { - // Zero is used to skip rounding - resolveRef(config)->setPointScaleFactor(0.0f); - } else { - resolveRef(config)->setPointScaleFactor(pixelsInPoint); - } + resolveRef(config)->setPointScaleFactor(pixelsInPoint); } float YGConfigGetPointScaleFactor(const YGConfigConstRef config) {