[clang] [StaticAnalyzer] Use llvm::count (NFC) (PR #141370)
via cfe-commits
cfe-commits at lists.llvm.org
Sat May 24 13:41:02 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/141370.diff
1 Files Affected:
- (modified) clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp (+1-5)
``````````diff
diff --git a/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp b/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
index 434c1d1526a22..4cb6bd34fa36d 100644
--- a/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
+++ b/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
@@ -35,11 +35,7 @@ class ResultMap {
public:
ResultMap(std::initializer_list<std::pair<CallDescription, bool>> Data)
- : Found(0),
- Total(std::count_if(Data.begin(), Data.end(),
- [](const std::pair<CallDescription, bool> &Pair) {
- return Pair.second == true;
- })),
+ : Found(0), Total(llvm::count(llvm::make_second_range(Data), true)),
Impl(std::move(Data)) {}
const bool *lookup(const CallEvent &Call) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/141370
More information about the cfe-commits
mailing list