Skip to content

[clangd] Use llvm::find (NFC) #143317

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

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jun 8, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp (+5-7)
diff --git a/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp b/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
index 03e65768c26a6..ae2d98ce90d8f 100644
--- a/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
+++ b/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
@@ -247,13 +247,11 @@ import Dep;
       ProjectModules->getRequiredModules(getFullPath("M.cppm")).empty());
 
   // Set the mangler to filter out the invalid flag
-  ProjectModules->setCommandMangler(
-      [](tooling::CompileCommand &Command, PathRef) {
-        auto const It =
-            std::find(Command.CommandLine.begin(), Command.CommandLine.end(),
-                      "-invalid-unknown-flag");
-        Command.CommandLine.erase(It);
-      });
+  ProjectModules->setCommandMangler([](tooling::CompileCommand &Command,
+                                       PathRef) {
+    auto const It = llvm::find(Command.CommandLine, "-invalid-unknown-flag");
+    Command.CommandLine.erase(It);
+  });
 
   // And now it returns a non-empty list of required modules since the
   // compilation succeeded

@llvmbot
Copy link
Member

llvmbot commented Jun 8, 2025

@llvm/pr-subscribers-clangd

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp (+5-7)
diff --git a/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp b/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
index 03e65768c26a6..ae2d98ce90d8f 100644
--- a/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
+++ b/clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp
@@ -247,13 +247,11 @@ import Dep;
       ProjectModules->getRequiredModules(getFullPath("M.cppm")).empty());
 
   // Set the mangler to filter out the invalid flag
-  ProjectModules->setCommandMangler(
-      [](tooling::CompileCommand &Command, PathRef) {
-        auto const It =
-            std::find(Command.CommandLine.begin(), Command.CommandLine.end(),
-                      "-invalid-unknown-flag");
-        Command.CommandLine.erase(It);
-      });
+  ProjectModules->setCommandMangler([](tooling::CompileCommand &Command,
+                                       PathRef) {
+    auto const It = llvm::find(Command.CommandLine, "-invalid-unknown-flag");
+    Command.CommandLine.erase(It);
+  });
 
   // And now it returns a non-empty list of required modules since the
   // compilation succeeded

@kazutakahirata kazutakahirata merged commit 240ff85 into llvm:main Jun 8, 2025
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250608_llvm_find_clangd branch June 8, 2025 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants