aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
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()) {