From f071e37fdb800c58f4fe3e1b963284983ea3770f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 23 Nov 2025 11:52:51 -0800 Subject: [PATCH] [StaticAnalyzer] Use llvm::find_if (NFC) Identified with llvm-use-ranges. --- clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp index 6673f2f319c0e..aafd8d45537e3 100644 --- a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp @@ -202,11 +202,10 @@ SarifDiagnostics::createResult(const PathDiagnostic *Diag, // Find the HTML report that was generated for this issue, if one exists. PDFileEntry::ConsumerFiles *Files = FM->getFiles(*Diag); if (Files) { - auto HtmlFile = - std::find_if(Files->cbegin(), Files->cend(), [](auto &File) { - return File.first == HTML_DIAGNOSTICS_NAME; - }); - if (HtmlFile != Files->cend()) { + auto HtmlFile = llvm::find_if(*Files, [](const auto &File) { + return File.first == HTML_DIAGNOSTICS_NAME; + }); + if (HtmlFile != Files->end()) { SmallString<128> HtmlReportPath = llvm::sys::path::parent_path(OutputFile); llvm::sys::path::append(HtmlReportPath, HtmlFile->second);