Skip to content

Commit

Permalink
[Edit] Use StringRef::consume_back (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Jan 28, 2024
1 parent 72fd10a commit d1427fb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions clang/lib/Edit/RewriteObjCFoundationAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,7 @@ static bool getLiteralInfo(SourceRange literalRange,

struct Suff {
static bool has(StringRef suff, StringRef &text) {
if (text.ends_with(suff)) {
text = text.substr(0, text.size()-suff.size());
return true;
}
return false;
return text.consume_back(suff);
}
};

Expand Down

0 comments on commit d1427fb

Please sign in to comment.