From 0e533f30816f86a949baa337046604c09973e899 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Wed, 3 Jan 2024 09:34:58 -0800 Subject: [PATCH] Add position type check to layout metrics == operator (#42020) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42020 I added position type in D51412428 (https://github.com/facebook/react-native/pull/41819). I didn't notice this == override which makes it so position type in layout metrics will not be updated if it changes. To use this cpp 20 feature we needed to change a few buck files which is also done here Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D52339890 fbshipit-source-id: e77ee092477dbf786e4a72e6a33138ccbc450645 --- .../react/renderer/core/LayoutMetrics.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/core/LayoutMetrics.h b/packages/react-native/ReactCommon/react/renderer/core/LayoutMetrics.h index 1541e270d07..0034b11bda2 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/LayoutMetrics.h +++ b/packages/react-native/ReactCommon/react/renderer/core/LayoutMetrics.h @@ -65,24 +65,7 @@ struct LayoutMetrics { frame.size.height - borderWidth.top - borderWidth.bottom}}; } - bool operator==(const LayoutMetrics& rhs) const { - return std::tie( - this->frame, - this->contentInsets, - this->borderWidth, - this->displayType, - this->layoutDirection, - this->pointScaleFactor, - this->overflowInset) == - std::tie( - rhs.frame, - rhs.contentInsets, - rhs.borderWidth, - rhs.displayType, - rhs.layoutDirection, - rhs.pointScaleFactor, - rhs.overflowInset); - } + bool operator==(const LayoutMetrics& rhs) const = default; bool operator!=(const LayoutMetrics& rhs) const { return !(*this == rhs);