projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9f88e5
)
[clang][NFC] Use llvm::count_if instead of manual loop
author
Timm Bäder
<tbaeder@redhat.com>
Sun, 14 May 2023 07:45:51 +0000
(09:45 +0200)
committer
Timm Bäder
<tbaeder@redhat.com>
Tue, 16 May 2023 13:35:05 +0000
(15:35 +0200)
clang/lib/Frontend/DiagnosticRenderer.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Frontend/DiagnosticRenderer.cpp
b/clang/lib/Frontend/DiagnosticRenderer.cpp
index
4cd7d98
..
18c8be7
100644
(file)
--- a/
clang/lib/Frontend/DiagnosticRenderer.cpp
+++ b/
clang/lib/Frontend/DiagnosticRenderer.cpp
@@
-494,10
+494,8
@@
static bool checkRangesForMacroArgExpansion(FullSourceLoc Loc,
mapDiagnosticRanges(Loc, Ranges, SpellingRanges);
// Count all valid ranges.
- unsigned ValidCount = 0;
- for (const auto &Range : Ranges)
- if (Range.isValid())
- ValidCount++;
+ unsigned ValidCount =
+ llvm::count_if(Ranges, [](const auto &R) { return R.isValid(); });
if (ValidCount > SpellingRanges.size())
return false;