[llvm] [Support] Use StringMap::contains (NFC) (PR #168673)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 22:39:46 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Identified with readability-container-contains.


---
Full diff: https://github.com/llvm/llvm-project/pull/168673.diff


1 Files Affected:

- (modified) llvm/lib/Support/SpecialCaseList.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 9f069bebcec73..7495308675c1d 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -455,7 +455,7 @@ unsigned SpecialCaseList::Section::getLastMatch(StringRef Prefix,
 }
 
 bool SpecialCaseList::Section::hasPrefix(StringRef Prefix) const {
-  return Impl->Entries.find(Prefix) != Impl->Entries.end();
+  return Impl->Entries.contains(Prefix);
 }
 
 } // namespace llvm

``````````

</details>


https://github.com/llvm/llvm-project/pull/168673


More information about the llvm-commits mailing list