aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-11 15:37:41 -0700
committerGitHub <noreply@github.com>2025-05-11 15:37:41 -0700
commit18549aa1ccb6621ee856465d5e68982c3cc90f5f (patch)
tree3241698ba045944fe4b5d4d902e90d9232f59811 /llvm/lib/Support/CommandLine.cpp
parent6f84ec3496f5ec9038a59c11d2ea495f1e601049 (diff)
downloadllvm-18549aa1ccb6621ee856465d5e68982c3cc90f5f.zip
llvm-18549aa1ccb6621ee856465d5e68982c3cc90f5f.tar.gz
llvm-18549aa1ccb6621ee856465d5e68982c3cc90f5f.tar.bz2
[llvm] Use StringRef::drop_back (NFC) (#139471)
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index f1dd39c..a407be9 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -726,7 +726,7 @@ static Option *getOptionPred(StringRef Name, size_t &Length,
// characters in it (so that the next iteration will not be the empty
// string.
while (OMI == OptionsMap.end() && Name.size() > 1) {
- Name = Name.substr(0, Name.size() - 1); // Chop off the last character.
+ Name = Name.drop_back();
OMI = OptionsMap.find(Name);
if (OMI != OptionsMap.end() && !Pred(OMI->getValue()))
OMI = OptionsMap.end();