From: Peter Munch Date: Wed, 25 Aug 2021 17:15:38 +0000 (+0200) Subject: Replace loop by range-based loop X-Git-Tag: v9.4.0-rc1~1031^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12707%2Fhead;p=dealii.git Replace loop by range-based loop --- diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index 0035491eb9..2945a0f7b7 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -225,31 +225,26 @@ namespace parallel unsigned int dummy = 0; unsigned int req_counter = 0; - for (std::set::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::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);