[llvm] 796d5a8 - [ADT] Use a range-based for loop instead of llvm::for_each (NFC) (#149542)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 10:43:54 PDT 2025


Author: Kazu Hirata
Date: 2025-07-18T10:43:51-07:00
New Revision: 796d5a89a12407fb0fdf74ea063259b6ca7333d9

URL: https://github.com/llvm/llvm-project/commit/796d5a89a12407fb0fdf74ea063259b6ca7333d9
DIFF: https://github.com/llvm/llvm-project/commit/796d5a89a12407fb0fdf74ea063259b6ca7333d9.diff

LOG: [ADT] Use a range-based for loop instead of llvm::for_each (NFC) (#149542)

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

Added: 
    

Modified: 
    llvm/include/llvm/ADT/CombinationGenerator.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/CombinationGenerator.h b/llvm/include/llvm/ADT/CombinationGenerator.h
index 6100aa9812293..bbdbd9bfa1be3 100644
--- a/llvm/include/llvm/ADT/CombinationGenerator.h
+++ b/llvm/include/llvm/ADT/CombinationGenerator.h
@@ -118,10 +118,9 @@ class CombinationGenerator {
       : VariablesChoices(VariablesChoices_) {
 #ifndef NDEBUG
     assert(!VariablesChoices.empty() && "There should be some variables.");
-    llvm::for_each(VariablesChoices, [](ArrayRef<choice_type> VariableChoices) {
+    for (ArrayRef<choice_type> VariableChoices : VariablesChoices)
       assert(!VariableChoices.empty() &&
              "There must always be some choice, at least a placeholder one.");
-    });
 #endif
   }
 


        


More information about the llvm-commits mailing list