From 9112053cee3665b1ff30bf3fef90c11c35304fe5 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 15 Nov 2024 14:51:21 -0500 Subject: [PATCH] Use std::ranges::any_of instead of std::any_of (#4539) This is suggested by clang-tidy's modernize checks, and is a safer coding practice. --- toolchain/driver/compile_subcommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/driver/compile_subcommand.cpp b/toolchain/driver/compile_subcommand.cpp index b4af7bf4758f..f39949cbca1a 100644 --- a/toolchain/driver/compile_subcommand.cpp +++ b/toolchain/driver/compile_subcommand.cpp @@ -787,8 +787,8 @@ auto CompileSubcommand::Run(DriverEnv& driver_env) -> DriverResult { } // Unlike previous steps, errors block further progress. - if (std::any_of(units.begin(), units.end(), - [&](const auto& unit) { return !unit->success(); })) { + if (std::ranges::any_of(units, + [&](const auto& unit) { return !unit->success(); })) { CARBON_VLOG_TO(driver_env.vlog_stream, "*** Stopping before lowering due to errors ***"); return make_result();