Skip to content

Conversation

kazutakahirata
Copy link
Contributor

We can use Base::contains.

We can use Base::contains.
@llvmbot
Copy link
Member

llvmbot commented Sep 7, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

We can use Base::contains.


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

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/StringSet.h (+1-1)
diff --git a/llvm/include/llvm/ADT/StringSet.h b/llvm/include/llvm/ADT/StringSet.h
index 13d2c406c4ff2..b4853423a1ef3 100644
--- a/llvm/include/llvm/ADT/StringSet.h
+++ b/llvm/include/llvm/ADT/StringSet.h
@@ -57,7 +57,7 @@ class StringSet : public StringMap<std::nullopt_t, AllocatorTy> {
   }
 
   /// Check if the set contains the given \c key.
-  bool contains(StringRef key) const { return Base::FindKey(key) != -1; }
+  bool contains(StringRef key) const { return Base::contains(key); }
 };
 
 } // end namespace llvm

@kazutakahirata kazutakahirata merged commit 7ef9530 into llvm:main Sep 7, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250906pm_ADT_StringSet_contains branch September 7, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants