[clang-tidy] Use StringRef::consume_back (NFC) (#139412)

This commit is contained in:
Kazu Hirata
2025-05-10 16:05:45 -07:00
committed by GitHub
parent fd98612acc
commit 8e9da213ea

View File

@@ -19,9 +19,8 @@ namespace {
StringRef removeFirstSuffix(StringRef Str, ArrayRef<const char *> Suffixes) {
for (StringRef Suffix : Suffixes) {
if (Str.ends_with(Suffix)) {
return Str.substr(0, Str.size() - Suffix.size());
}
if (Str.consume_back(Suffix))
return Str;
}
return Str;
}