Skip to content

[lldb] Use llvm::is_contained (NFC) #146012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

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
rlavaee pushed a commit to rlavaee/llvm-project that referenced this pull request Jul 1, 2025
llvm::is_contained is shorter than llvm::find plus a comparison.
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