[llvm] [BOLT] Use StringRef::contains (NFC) (PR #92842)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 18:52:33 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/92842

None

>From 95bd29fc0b2213dd26d23841c48149ad0368fe3e Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Mon, 20 May 2024 18:33:33 -0700
Subject: [PATCH] [BOLT] Use StringRef::contains (NFC)

---
 bolt/lib/Profile/DataAggregator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp
index e06debcee741e..f55caa7f03f73 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -1227,7 +1227,7 @@ ErrorOr<Location> DataAggregator::parseLocationOrOffset() {
   if (Sep == StringRef::npos)
     return parseOffset();
   StringRef LookAhead = ParsingBuf.substr(0, Sep);
-  if (LookAhead.find_first_of(":") == StringRef::npos)
+  if (!LookAhead.contains(':'))
     return parseOffset();
 
   ErrorOr<StringRef> BuildID = parseString(':');



More information about the llvm-commits mailing list