aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-01-12 18:39:53 -0800
committerKazu Hirata <kazu@google.com>2024-01-12 18:39:53 -0800
commit1df4fb98813a33d14f2112a1bb906039d112fa3f (patch)
tree0fb41317f0d4e393962d7fc76b1b5c50b18f3ec6 /llvm/lib/Support/StringRef.cpp
parent771ab15e4881b9c4adaabb694d901c3dbeb1fa47 (diff)
downloadllvm-1df4fb98813a33d14f2112a1bb906039d112fa3f.zip
llvm-1df4fb98813a33d14f2112a1bb906039d112fa3f.tar.gz
llvm-1df4fb98813a33d14f2112a1bb906039d112fa3f.tar.bz2
[Support] Use StringRef::ltrim (NFC)
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
-rw-r--r--llvm/lib/Support/StringRef.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index decd06a..945ae37 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -517,8 +517,7 @@ bool StringRef::consumeInteger(unsigned Radix, APInt &Result) {
// Skip leading zeroes. This can be a significant improvement if
// it means we don't need > 64 bits.
- while (!Str.empty() && Str.front() == '0')
- Str = Str.substr(1);
+ Str = Str.ltrim('0');
// If it was nothing but zeroes....
if (Str.empty()) {