]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use a range-based for loop. 15465/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 24 Jun 2023 22:43:45 +0000 (16:43 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 24 Jun 2023 22:43:45 +0000 (16:43 -0600)
source/base/mpi.cc

index 212814f83ca25c3501ea2caabbbf0cca64127f41..dab88e2b97702ea39a96ae9d07f16d1de095633d 100644 (file)
@@ -788,9 +788,9 @@ namespace Utilities
         // likely did not intend. As a consequence, filter out this specific
         // flag.
         std::vector<char *> 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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.