Skip to content

Commit 950ea91

Browse files
TatianaKaposfacebook-github-bot
authored andcommitted
Fix windows warning/error over unsigned int (facebook#34947)
Summary: react-native-windows treats compiler c++ warning as errors, this is one of them. It fixes it by assigning i to unsigned instead of auto. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - Fix react-native-windows compiler warning in AttributedString Pull Request resolved: facebook#34947 Test Plan: [code](https://github.com/microsoft/react-native-windows/pull/10479/files#diff-c14f3a9383607a661977aa577c75bbc547827502950e0244721ef021f549fbe2) is already merged into react-native-windows and passing all tests. The for loop changed is also used directly above in AttributedString::compareTextAttributesWithoutFrame Reviewed By: shwanton Differential Revision: D40459186 Pulled By: NickGerleman fbshipit-source-id: 848375f75f3df0cd086d758a239e86f39b43aa3f
1 parent 7dc2499 commit 950ea91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactCommon/react/renderer/attributedstring/AttributedString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ bool AttributedString::compareTextAttributesWithoutFrame(
112112
return false;
113113
}
114114

115-
for (unsigned i = 0; i < fragments_.size(); i++) {
115+
for (size_t i = 0; i < fragments_.size(); i++) {
116116
if (fragments_[i].textAttributes != rhs.fragments_[i].textAttributes ||
117117
fragments_[i].string != rhs.fragments_[i].string) {
118118
return false;
@@ -135,7 +135,7 @@ bool AttributedString::isContentEqual(const AttributedString &rhs) const {
135135
return false;
136136
}
137137

138-
for (auto i = 0; i < fragments_.size(); i++) {
138+
for (size_t i = 0; i < fragments_.size(); i++) {
139139
if (!fragments_[i].isContentEqual(rhs.fragments_[i])) {
140140
return false;
141141
}

0 commit comments

Comments
 (0)