Skip to content

Commit

Permalink
Remove unneeded const_cast (#41712)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Nov 30, 2023
1 parent ede35df commit 7e5f15b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<yoga::Config*>(&child.yogaConfig_));
auto childErrata = YGConfigGetErrata(&child.yogaConfig_);

if (child.yogaTreeHasBeenConfigured_ &&
childLayoutMetrics.pointScaleFactor == pointScaleFactor &&
Expand Down

0 comments on commit 7e5f15b

Please sign in to comment.