[Frontend] Use StringRef::drop_while (NFC)

This commit is contained in:
Kazu Hirata 2023-12-28 10:06:20 -08:00
parent 7f69c8b3a6
commit 5c37e711df

View File

@ -147,8 +147,7 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) {
// Skip over this offset, the following comma, and any spaces. // Skip over this offset, the following comma, and any spaces.
LineStr = LineStr.substr(1); LineStr = LineStr.substr(1);
while (!LineStr.empty() && isWhitespace(LineStr[0])) LineStr = LineStr.drop_while(isWhitespace);
LineStr = LineStr.substr(1);
} }
} }
@ -163,8 +162,7 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) {
// Skip over this offset, the following comma, and any spaces. // Skip over this offset, the following comma, and any spaces.
LineStr = LineStr.substr(1); LineStr = LineStr.substr(1);
while (!LineStr.empty() && isWhitespace(LineStr[0])) LineStr = LineStr.drop_while(isWhitespace);
LineStr = LineStr.substr(1);
} }
continue; continue;
} }
@ -180,8 +178,7 @@ LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) {
// Skip over this offset, the following comma, and any spaces. // Skip over this offset, the following comma, and any spaces.
LineStr = LineStr.substr(1); LineStr = LineStr.substr(1);
while (!LineStr.empty() && isWhitespace(LineStr[0])) LineStr = LineStr.drop_while(isWhitespace);
LineStr = LineStr.substr(1);
} }
} }
} }