Skip to content

Commit 54db657

Browse files
[StaticAnalyzer] Use llvm::find_if (NFC) (#169237)
Identified with llvm-use-ranges.
1 parent d124675 commit 54db657

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,10 @@ SarifDiagnostics::createResult(const PathDiagnostic *Diag,
202202
// Find the HTML report that was generated for this issue, if one exists.
203203
PDFileEntry::ConsumerFiles *Files = FM->getFiles(*Diag);
204204
if (Files) {
205-
auto HtmlFile =
206-
std::find_if(Files->cbegin(), Files->cend(), [](auto &File) {
207-
return File.first == HTML_DIAGNOSTICS_NAME;
208-
});
209-
if (HtmlFile != Files->cend()) {
205+
auto HtmlFile = llvm::find_if(*Files, [](const auto &File) {
206+
return File.first == HTML_DIAGNOSTICS_NAME;
207+
});
208+
if (HtmlFile != Files->end()) {
210209
SmallString<128> HtmlReportPath =
211210
llvm::sys::path::parent_path(OutputFile);
212211
llvm::sys::path::append(HtmlReportPath, HtmlFile->second);

0 commit comments

Comments
 (0)