Skip to content

Commit f9754d3

Browse files
Harini Malothumeta-codesync[bot]
authored andcommitted
Ccomparison between signed and unsigned values, causing a error (#54318)
Summary: We saw this error while integrating changes in react native windows microsoft/react-native-windows#15292 Fixed type consistency in cloneMultipleRecursive by using size_t for loop iterator to properly match vector size type, improving type safety when iterating over children nodes. ## Changelog: [GENERAL][FIXED] - Use size_t instead of int for vector iteration in cloneMultipleRecursive <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: |GENERAL|FIXED|- Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #54318 Reviewed By: christophpurrer Differential Revision: D85800905 Pulled By: javache fbshipit-source-id: 2fdb539e1c9af56eebdd5c7a900fa0e697bcab3a
1 parent d0015e0 commit f9754d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ std::shared_ptr<ShadowNode> cloneMultipleRecursive(
421421
std::shared_ptr<std::vector<std::shared_ptr<const ShadowNode>>> newChildren;
422422
auto count = childrenCount.at(family);
423423

424-
for (int i = 0; count > 0 && i < children.size(); i++) {
424+
for (size_t i = 0; count > 0 && i < children.size(); i++) {
425425
const auto childFamily = &children[i]->getFamily();
426426
if (childrenCount.contains(childFamily)) {
427427
count--;

0 commit comments

Comments
 (0)