From a9bc1118b755c362a981638c0ce0091affd46fe0 Mon Sep 17 00:00:00 2001 From: Kacper Kafara Date: Thu, 27 Jun 2024 14:08:20 +0200 Subject: [PATCH] refact(Android): rename `compareFrameSizes` to `checkFrameSizesEqualWithEps` (#2217) ## Description As suggested by @alduzy, new the new function name should better convey its behaviour. Old came `compareFrameSizes` could suggest inequality. ## Changes Renamed `compareFrameSizes` to `checkFrameSizesEqualWithEps`. ## Test code and steps to reproduce Android should build on Fabric => CI ## Checklist - [ ] Ensured that CI passes --- .../components/rnscreens/RNSScreenComponentDescriptor.h | 2 +- common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h b/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h index 59bdcdf760..37aac4e1ac 100644 --- a/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +++ b/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h @@ -51,7 +51,7 @@ class RNSScreenComponentDescriptor final // state update. if (screenShadowNode.getFrameCorrectionModes().check( FrameCorrectionModes::Mode::FrameHeightCorrection) && - !compareFrameSizes( + !checkFrameSizesEqualWithEps( screenShadowNode.layoutMetrics_.frame.size, stateData.frameSize)) { LOG(ERROR) diff --git a/common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h b/common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h index 8450c58296..b7407172b5 100644 --- a/common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h +++ b/common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h @@ -25,7 +25,7 @@ inline constexpr bool equalWithRespectToEps(const T a, const T b, const T eps) { * @return whether the frame dimensions are the same with respect to given * epsilon */ -inline constexpr bool compareFrameSizes( +inline constexpr bool checkFrameSizesEqualWithEps( const react::Size &first, const react::Size &second, const react::Float eps = 0.01) {