Skip to content

Conversation

kazutakahirata
Copy link
Contributor

LLVM Coding Standards discourages llvm::for_each unless we already
have a callable.

LLVM Coding Standards discourages llvm::for_each unless we already
have a callable.
@llvmbot
Copy link
Member

llvmbot commented Jul 18, 2025

@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)

Changes

LLVM Coding Standards discourages llvm::for_each unless we already
have a callable.


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

1 Files Affected:

  • (modified) lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp (+1-2)
diff --git a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp
index f9aa6b1a98765..b775ec98c9a17 100644
--- a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp
+++ b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp
@@ -87,9 +87,8 @@ class PluginProperties : public Properties {
   void ServerURLsChangedCallback() {
     m_server_urls = GetDebugInfoDURLs();
     llvm::SmallVector<llvm::StringRef> dbginfod_urls;
-    llvm::for_each(m_server_urls, [&](const auto &obj) {
+    for (const auto &obj : m_server_urls)
       dbginfod_urls.push_back(obj.ref());
-    });
     llvm::setDefaultDebuginfodUrls(dbginfod_urls);
   }
   // Storage for the StringRef's used within the Debuginfod library.

@kazutakahirata kazutakahirata merged commit 3c1a09d into llvm:main Jul 18, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250718_llvm_for_each_lldb branch July 18, 2025 20:32
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