From 1df4fb98813a33d14f2112a1bb906039d112fa3f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 12 Jan 2024 18:39:53 -0800 Subject: [Support] Use StringRef::ltrim (NFC) --- llvm/lib/Support/StringRef.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Support/StringRef.cpp') 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()) { -- cgit v1.1