We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd98612 commit 8e9da21Copy full SHA for 8e9da21
clang-tools-extra/clang-tidy/utils/IncludeSorter.cpp
@@ -19,9 +19,8 @@ namespace {
19
20
StringRef removeFirstSuffix(StringRef Str, ArrayRef<const char *> Suffixes) {
21
for (StringRef Suffix : Suffixes) {
22
- if (Str.ends_with(Suffix)) {
23
- return Str.substr(0, Str.size() - Suffix.size());
24
- }
+ if (Str.consume_back(Suffix))
+ return Str;
25
}
26
return Str;
27
0 commit comments