diff --git a/kratos/mpi/utilities/gather_modelpart_utility.cpp b/kratos/mpi/utilities/gather_modelpart_utility.cpp index 623ba37835f6..1e24f55da3c5 100644 --- a/kratos/mpi/utilities/gather_modelpart_utility.cpp +++ b/kratos/mpi/utilities/gather_modelpart_utility.cpp @@ -330,7 +330,7 @@ void GatherModelPartUtility::GatherEntityFromOtherPartitions( // Allocating the temporary entities to bring container ContainerType entities_to_bring; std::size_t counter = 0; - for (auto& r_bring : rEntitiesToBring) { + for (const auto& r_bring : rEntitiesToBring) { counter += r_bring.second.size(); } entities_to_bring.reserve(counter);