Skip to content

Commit c033db7

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Replace a usage of reverse iterators with std::ranges::reverse_view (#51761)
Summary: Sanity checking that everywhere we test has new enough stdlib to support this. Changelog: [Internal] Differential Revision: D75834622
1 parent ab9ff88 commit c033db7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include "LayoutableShadowNode.h"
99

10+
#include <ranges>
11+
1012
#include <react/renderer/core/LayoutConstraints.h>
1113
#include <react/renderer/core/LayoutContext.h>
1214
#include <react/renderer/core/LayoutMetrics.h>
@@ -83,8 +85,8 @@ LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics(
8385
// root because we measure it from an outside tree perspective.
8486
shadowNodeList.push_back(descendantNode);
8587

86-
for (auto it = ancestors.rbegin(); it != ancestors.rend(); it++) {
87-
auto& shadowNode = it->first.get();
88+
for (auto& ancestor : std::ranges::reverse_view(ancestors)) {
89+
auto& shadowNode = ancestor.first.get();
8890

8991
shadowNodeList.push_back(&shadowNode);
9092

0 commit comments

Comments
 (0)