From 7e5f15b889a1571be655d1fbaa503319bfc1f305 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 30 Nov 2023 12:10:50 -0800 Subject: [PATCH] Remove unneeded const_cast (#41712) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41712 I fixed the const correctness of YGConfigGetErrata a while back when fixing up other YGConfig accessors. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D51689323 fbshipit-source-id: 1af3deb44ec03a8a65643fa1496c534ac8f6d057 --- .../renderer/components/view/YogaLayoutableShadowNode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index 96e3cb75a7e7af..d828c84b08cd49 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -470,8 +470,7 @@ void YogaLayoutableShadowNode::configureYogaTree( for (size_t i = 0; i < yogaLayoutableChildren_.size(); i++) { const auto& child = *yogaLayoutableChildren_[i]; auto childLayoutMetrics = child.getLayoutMetrics(); - auto childErrata = - YGConfigGetErrata(const_cast(&child.yogaConfig_)); + auto childErrata = YGConfigGetErrata(&child.yogaConfig_); if (child.yogaTreeHasBeenConfigured_ && childLayoutMetrics.pointScaleFactor == pointScaleFactor &&