]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace loop by range-based loop 12707/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 25 Aug 2021 17:15:38 +0000 (19:15 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 26 Aug 2021 19:32:48 +0000 (21:32 +0200)
source/distributed/tria_base.cc

index 0035491eb92aef78cf519820d7dda7273e5d4334..2945a0f7b7dc671b9acd110ecf7be8cdca9eac0c 100644 (file)
@@ -225,31 +225,26 @@ namespace parallel
           unsigned int dummy       = 0;
           unsigned int req_counter = 0;
 
-          for (std::set<types::subdomain_id>::iterator it =
-                 this->number_cache.level_ghost_owners.begin();
-               it != this->number_cache.level_ghost_owners.end();
-               ++it, ++req_counter)
+          for (const auto &it : this->number_cache.level_ghost_owners)
             {
               ierr = MPI_Isend(&dummy,
                                1,
                                MPI_UNSIGNED,
-                               *it,
+                               it,
                                mpi_tag,
                                this->mpi_communicator,
                                &requests[req_counter]);
               AssertThrowMPI(ierr);
+              ++req_counter;
             }
 
-          for (std::set<types::subdomain_id>::iterator it =
-                 this->number_cache.level_ghost_owners.begin();
-               it != this->number_cache.level_ghost_owners.end();
-               ++it)
+          for (const auto &it : this->number_cache.level_ghost_owners)
             {
               unsigned int dummy;
               ierr = MPI_Recv(&dummy,
                               1,
                               MPI_UNSIGNED,
-                              *it,
+                              it,
                               mpi_tag,
                               this->mpi_communicator,
                               MPI_STATUS_IGNORE);

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.