From 513865f8a7c6e8640d0406793999750dd22e723b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 24 Jun 2023 16:43:45 -0600 Subject: [PATCH] Use a range-based for loop. --- source/base/mpi.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 212814f83c..dab88e2b97 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -788,9 +788,9 @@ namespace Utilities // likely did not intend. As a consequence, filter out this specific // flag. std::vector argv_new; - for (int i = 0; i < argc; ++i) - if (strcmp(argv[i], "--help") != 0) - argv_new.push_back(argv[i]); + for (const auto arg : make_array_view(&argv[0], &argv[0] + argc)) + if (strcmp(arg, "--help") != 0) + argv_new.push_back(arg); std::stringstream threads_flag; #if KOKKOS_VERSION >= 30700 -- 2.39.5