Skip to content

Commit a3f379e

Browse files
[Frontend] Use StringRef::consume_back (NFC)
1 parent 70c3e30 commit a3f379e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/Frontend/VerifyDiagnosticConsumer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,9 @@ static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM,
445445
// others.
446446

447447
// Regex in initial directive token: -re
448-
if (DToken.ends_with("-re")) {
448+
if (DToken.consume_back("-re")) {
449449
D.RegexKind = true;
450450
KindStr = "regex";
451-
DToken = DToken.substr(0, DToken.size()-3);
452451
}
453452

454453
// Type in initial directive token: -{error|warning|note|no-diagnostics}

0 commit comments

Comments
 (0)