From e2ac91792afe2d794f069b14eae9e75596f13b6a Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Wed, 25 Aug 2021 19:15:38 +0200 Subject: [PATCH] Replace loop by range-based loop --- source/distributed/tria_base.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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); -- 2.39.5