From 093ed0106463db2cf461d82f71e7a14247c13579 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 14 Aug 2024 11:10:46 -0500 Subject: [PATCH] Fix one more lambda in unevaluated context issue --- source/grid/grid_tools.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 0c5cd92a70d0..c25113eef152 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -3808,18 +3808,19 @@ namespace GridTools void DistributedComputePointLocationsInternal::finalize_setup() { - // before reshuffeling the data check if data.recv_components and +#ifdef DEBUG + // Before reshuffeling the data check if data.recv_components and // n_searched_points are in a valid state. Assert(n_searched_points != numbers::invalid_unsigned_int, ExcInternalError()); - Assert(recv_components.empty() || - std::get<1>(*std::max_element(recv_components.begin(), - recv_components.end(), - [](const auto &a, const auto &b) { - return std::get<1>(a) < - std::get<1>(b); - })) < n_searched_points, - ExcInternalError()); + const bool have_valid_state = + std::get<1>(*std::max_element(recv_components.begin(), + recv_components.end(), + [](const auto &a, const auto &b) { + return std::get<1>(a) < std::get<1>(b); + })) < n_searched_points; + Assert(recv_components.empty() || have_valid_state, ExcInternalError()); +#endif send_ranks.clear(); recv_ranks.clear();