From: Wolfgang Bangerth Date: Sat, 24 Jun 2023 22:43:45 +0000 (-0600) Subject: Use a range-based for loop. X-Git-Tag: v9.5.0-rc1~26^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15465%2Fhead;p=dealii.git Use a range-based for loop. --- 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