[clang] [Format] Use llvm::count_if (NFC) (PR #141518)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 26 13:02:31 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-format
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/141518.diff
1 Files Affected:
- (modified) clang/lib/Format/MacroCallReconstructor.cpp (+2-3)
``````````diff
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
``````````
</details>
https://github.com/llvm/llvm-project/pull/141518
More information about the cfe-commits
mailing list