[llvm] 3be989e - [FileCheck] Use StringRef::rtrim (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 3 21:43:16 PST 2024
Author: Kazu Hirata
Date: 2024-02-03T21:43:03-08:00
New Revision: 3be989e8c30f3cad61e5e1fa54199fc45edf7ff7
URL: https://github.com/llvm/llvm-project/commit/3be989e8c30f3cad61e5e1fa54199fc45edf7ff7
DIFF: https://github.com/llvm/llvm-project/commit/3be989e8c30f3cad61e5e1fa54199fc45edf7ff7.diff
LOG: [FileCheck] Use StringRef::rtrim (NFC)
Added:
Modified:
llvm/lib/FileCheck/FileCheck.cpp
Removed:
################################################################################
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp
index 0d5bdf7903a20..221fcffa5e8c7 100644
--- a/llvm/lib/FileCheck/FileCheck.cpp
+++ b/llvm/lib/FileCheck/FileCheck.cpp
@@ -766,9 +766,7 @@ bool Pattern::parsePattern(StringRef PatternStr, StringRef Prefix,
if (!(Req.NoCanonicalizeWhiteSpace && Req.MatchFullLines))
// Ignore trailing whitespace.
- while (!PatternStr.empty() &&
- (PatternStr.back() == ' ' || PatternStr.back() == '\t'))
- PatternStr = PatternStr.substr(0, PatternStr.size() - 1);
+ PatternStr = PatternStr.rtrim(" \t");
// Check that there is something on the line.
if (PatternStr.empty() && CheckTy != Check::CheckEmpty) {
More information about the llvm-commits
mailing list