Skip to content

Commit 2b3baff

Browse files
[Analysis] Use StringRef::rtrim (NFC)
1 parent 8980936 commit 2b3baff

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

clang/lib/Analysis/PathDiagnostic.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,7 @@
5050
using namespace clang;
5151
using namespace ento;
5252

53-
static StringRef StripTrailingDots(StringRef s) {
54-
for (StringRef::size_type i = s.size(); i != 0; --i)
55-
if (s[i - 1] != '.')
56-
return s.substr(0, i);
57-
return {};
58-
}
53+
static StringRef StripTrailingDots(StringRef s) { return s.rtrim('.'); }
5954

6055
PathDiagnosticPiece::PathDiagnosticPiece(StringRef s,
6156
Kind k, DisplayHint hint)

0 commit comments

Comments
 (0)