Skip to content

Commit fb14c83

Browse files
[StaticAnalyzer] Use llvm::is_contained (NFC) (#141371)
1 parent 1cc9e6e commit fb14c83

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,8 @@ void RefLeakReport::findBindingToReport(CheckerContext &Ctx,
962962
// `AllocFirstBinding` to be one of them. In situations like this,
963963
// it would still be the easiest case to explain to our users.
964964
if (!AllVarBindings.empty() &&
965-
llvm::count_if(AllVarBindings,
966-
[this](const std::pair<const MemRegion *, SVal> Binding) {
967-
return Binding.first == AllocFirstBinding;
968-
}) == 0) {
965+
!llvm::is_contained(llvm::make_first_range(AllVarBindings),
966+
AllocFirstBinding)) {
969967
// Let's pick one of them at random (if there is something to pick from).
970968
AllocBindingToReport = AllVarBindings[0].first;
971969

0 commit comments

Comments
 (0)