[clang] 23c2f88 - [Format] Use llvm::count_if (NFC) (#141518)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 26 19:43:31 PDT 2025
Author: Kazu Hirata
Date: 2025-05-26T19:43:28-07:00
New Revision: 23c2f8827b13ef8c72f09f931a70e088c35ccc77
URL: https://github.com/llvm/llvm-project/commit/23c2f8827b13ef8c72f09f931a70e088c35ccc77
DIFF: https://github.com/llvm/llvm-project/commit/23c2f8827b13ef8c72f09f931a70e088c35ccc77.diff
LOG: [Format] Use llvm::count_if (NFC) (#141518)
Added:
Modified:
clang/lib/Format/MacroCallReconstructor.cpp
Removed:
################################################################################
diff --git a/clang/lib/Format/MacroCallReconstructor.cpp b/clang/lib/Format/MacroCallReconstructor.cpp
index c9b618c6cb5b0..116bbad320e1f 100644
--- a/clang/lib/Format/MacroCallReconstructor.cpp
+++ b/clang/lib/Format/MacroCallReconstructor.cpp
@@ -511,9 +511,8 @@ MacroCallReconstructor::createUnwrappedLine(const ReconstructedLine &Line,
for (const auto &N : Line.Tokens) {
Result.Tokens.push_back(N->Tok);
UnwrappedLineNode &Current = Result.Tokens.back();
- auto NumChildren =
- std::count_if(N->Children.begin(), N->Children.end(),
- [](const auto &Child) { return !Child->Tokens.empty(); });
+ auto NumChildren = llvm::count_if(
+ N->Children, [](const auto &Child) { return !Child->Tokens.empty(); });
if (NumChildren == 1 && Current.Tok->isOneOf(tok::l_paren, tok::comma)) {
// If we only have one child, and the child is due to a macro expansion
// (either attached to a left parenthesis or comma), merge the child into
More information about the cfe-commits
mailing list