https://github.com/kazutakahirata created 
https://github.com/llvm/llvm-project/pull/149541

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


>From 906c5777505f9aeedef88c5eecf3327bf56406dd Mon Sep 17 00:00:00 2001
From: Kazu Hirata <k...@google.com>
Date: Thu, 17 Jul 2025 10:05:26 -0700
Subject: [PATCH] [lldb] Use a range-based for loop instead of llvm::for_each
 (NFC)

LLVM Coding Standards discourages llvm::for_each unless we already
have a callable.
---
 .../SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp       | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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.

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to