Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

llvm::is_contained is shorter than llvm::find plus a comparison.

llvm::is_contained is shorter than llvm::find plus a comparison.
@llvmbot
Copy link
Member

llvmbot commented Jun 27, 2025

@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)

Changes

llvm::is_contained is shorter than llvm::find plus a comparison.


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

1 Files Affected:

  • (modified) lldb/source/Symbol/SaveCoreOptions.cpp (+1-1)
diff --git a/lldb/source/Symbol/SaveCoreOptions.cpp b/lldb/source/Symbol/SaveCoreOptions.cpp
index 0f9dbb73c1721..f93b58f59cf96 100644
--- a/lldb/source/Symbol/SaveCoreOptions.cpp
+++ b/lldb/source/Symbol/SaveCoreOptions.cpp
@@ -23,7 +23,7 @@ Status SaveCoreOptions::SetPluginName(const char *name) {
 
   std::vector<llvm::StringRef> plugin_names =
       PluginManager::GetSaveCorePluginNames();
-  if (llvm::find(plugin_names, name) == plugin_names.end()) {
+  if (!llvm::is_contained(plugin_names, name)) {
     StreamString stream;
     stream.Printf("plugin name '%s' is not a valid ObjectFile plugin name.",
                   name);

@kazutakahirata kazutakahirata merged commit 1df3e0a into llvm:main Jun 27, 2025
9 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250626_is_contained_lldb branch June 27, 2025 14:39
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.

3 participants