Skip to content

Commit d1427fb

Browse files
[Edit] Use StringRef::consume_back (NFC)
1 parent 72fd10a commit d1427fb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clang/lib/Edit/RewriteObjCFoundationAPI.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,7 @@ static bool getLiteralInfo(SourceRange literalRange,
697697

698698
struct Suff {
699699
static bool has(StringRef suff, StringRef &text) {
700-
if (text.ends_with(suff)) {
701-
text = text.substr(0, text.size()-suff.size());
702-
return true;
703-
}
704-
return false;
700+
return text.consume_back(suff);
705701
}
706702
};
707703

0 commit comments

Comments
 (0)