aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-01-31 23:54:07 -0800
committerKazu Hirata <kazu@google.com>2024-01-31 23:54:07 -0800
commit39fa304866e16f1408a0cab9437e47e4ebacf206 (patch)
tree371c2aaa830ce6efdbc6e2e101ecb149aa0cfe73 /llvm/lib/Support/StringRef.cpp
parente8512786fedbfa6ddba70ceddc29d7122173ba5e (diff)
downloadllvm-39fa304866e16f1408a0cab9437e47e4ebacf206.zip
llvm-39fa304866e16f1408a0cab9437e47e4ebacf206.tar.gz
llvm-39fa304866e16f1408a0cab9437e47e4ebacf206.tar.bz2
[llvm] Use StringRef::starts_with (NFC)
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
-rw-r--r--llvm/lib/Support/StringRef.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/StringRef.cpp b/llvm/lib/Support/StringRef.cpp
index 945ae37..f104213 100644
--- a/llvm/lib/Support/StringRef.cpp
+++ b/llvm/lib/Support/StringRef.cpp
@@ -458,7 +458,7 @@ bool llvm::consumeSignedInteger(StringRef &Str, unsigned Radix,
unsigned long long ULLVal;
// Handle positive strings first.
- if (Str.empty() || Str.front() != '-') {
+ if (!Str.starts_with("-")) {
if (consumeUnsignedInteger(Str, Radix, ULLVal) ||
// Check for value so large it overflows a signed value.
(long long)ULLVal < 0)