Author: Kazu Hirata
Date: 2025-11-23T22:32:43-08:00
New Revision: 54db657b9ebdbce70f902313e6b303d85d68a4dc

URL: 
https://github.com/llvm/llvm-project/commit/54db657b9ebdbce70f902313e6b303d85d68a4dc
DIFF: 
https://github.com/llvm/llvm-project/commit/54db657b9ebdbce70f902313e6b303d85d68a4dc.diff

LOG: [StaticAnalyzer] Use llvm::find_if (NFC) (#169237)

Identified with llvm-use-ranges.

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp

Removed: 
    


################################################################################
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);


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to