Kaynağa Gözat

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.
Dana Jansens 1 yıl önce
ebeveyn
işleme
9112053cee
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      toolchain/driver/compile_subcommand.cpp

+ 2 - 2
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();