Skip to content

Commit 5c37e71

Browse files
committedDec 28, 2023
[Frontend] Use StringRef::drop_while (NFC)
1 parent 7f69c8b commit 5c37e71

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
 

‎clang/lib/Frontend/LayoutOverrideSource.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) {
147147

148148
// Skip over this offset, the following comma, and any spaces.
149149
LineStr = LineStr.substr(1);
150-
while (!LineStr.empty() && isWhitespace(LineStr[0]))
151-
LineStr = LineStr.substr(1);
150+
LineStr = LineStr.drop_while(isWhitespace);
152151
}
153152
}
154153

@@ -163,8 +162,7 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) {
163162

164163
// Skip over this offset, the following comma, and any spaces.
165164
LineStr = LineStr.substr(1);
166-
while (!LineStr.empty() && isWhitespace(LineStr[0]))
167-
LineStr = LineStr.substr(1);
165+
LineStr = LineStr.drop_while(isWhitespace);
168166
}
169167
continue;
170168
}
@@ -180,8 +178,7 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) {
180178

181179
// Skip over this offset, the following comma, and any spaces.
182180
LineStr = LineStr.substr(1);
183-
while (!LineStr.empty() && isWhitespace(LineStr[0]))
184-
LineStr = LineStr.substr(1);
181+
LineStr = LineStr.drop_while(isWhitespace);
185182
}
186183
}
187184
}

0 commit comments

Comments
 (0)