Skip to content

Commit d6ad67d

Browse files
[clang-tidy] Use StringRef::consume_back (NFC)
1 parent 8f8cab6 commit d6ad67d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ class ClangTidyDiagnosticRenderer : public DiagnosticRenderer {
6262
// appending the check name to the message in ClangTidyContext::diag and
6363
// using getCustomDiagID.
6464
std::string CheckNameInMessage = " [" + Error.DiagnosticName + "]";
65-
if (Message.ends_with(CheckNameInMessage))
66-
Message = Message.substr(0, Message.size() - CheckNameInMessage.size());
65+
Message.consume_back(CheckNameInMessage);
6766

6867
auto TidyMessage =
6968
Loc.isValid()

0 commit comments

Comments
 (0)