Fix for Clang tidy, needed for fbcode include (#44655)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44655

Required to compile with clang

This is because previously it was comparing size_t with int which is not allowed under compilation with clang

Changelog: [Internal] [Fixed] - Replaced old style for loop with new style to avoid clang errors with size_t to int comparisons

Differential Revision: D57721635

fbshipit-source-id: 2738f7b415d668c37536f7f93b2e0985fa2cc5e6
This commit is contained in:
John Mavrantonakis
2024-05-27 12:14:03 -07:00
committed by Facebook GitHub Bot
parent 29beea6b57
commit c207708c4b
@@ -63,9 +63,9 @@ void fromRawValue(
auto length = items.size();
result.clear();
result.reserve(length);
for (size_t i = 0; i < length; i++) {
for (auto& item : items) {
T itemResult;
fromRawValue(context, items.at(i), itemResult);
fromRawValue(context, item, itemResult);
result.push_back(itemResult);
}
return;
@@ -89,9 +89,9 @@ void fromRawValue(
auto length = items.size();
result.clear();
result.reserve(length);
for (int i = 0; i < length; i++) {
for (auto& item : items) {
T itemResult;
fromRawValue(context, items.at(i), itemResult);
fromRawValue(context, item, itemResult);
result.push_back(itemResult);
}
return;