From 28a774fd0953ef19a40946a6ab6c6abc28f79c7e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 29 Dec 2021 10:26:02 -0700 Subject: [PATCH] Make code readable by using 'auto'. --- include/deal.II/base/parallel.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/include/deal.II/base/parallel.h b/include/deal.II/base/parallel.h index a45bfd8ace..4cf5f035d1 100644 --- a/include/deal.II/base/parallel.h +++ b/include/deal.II/base/parallel.h @@ -153,8 +153,9 @@ namespace parallel internal::parallel_for( SyncIterators(x_begin), SyncIterators(x_end), - [predicate](const std::tuple &p) { - *std::get<1>(p) = predicate(*std::get<0>(p)); + [predicate](const auto &range) { + for (const auto &p : range) + *std::get<1>(p) = predicate(*std::get<0>(p)); }, grainsize); #endif @@ -213,9 +214,9 @@ namespace parallel internal::parallel_for( SyncIterators(x_begin), SyncIterators(x_end), - [predicate]( - const std::tuple &p) { - *std::get<2>(p) = predicate(*std::get<0>(p), *std::get<1>(p)); + [predicate](const auto &range) { + for (const auto &p : range) + *std::get<2>(p) = predicate(*std::get<0>(p), *std::get<1>(p)); }, grainsize); #endif @@ -279,12 +280,10 @@ namespace parallel internal::parallel_for( SyncIterators(x_begin), SyncIterators(x_end), - [predicate]( - const std:: - tuple - &p) { - *std::get<3>(p) = - predicate(*std::get<0>(p), *std::get<1>(p), *std::get<2>(p)); + [predicate](const auto &range) { + for (const auto &p : range) + *std::get<3>(p) = + predicate(*std::get<0>(p), *std::get<1>(p), *std::get<2>(p)); }, grainsize); #endif -- 2.39.5