From: Marco Feder <marco.feder@sissa.it>
Date: Wed, 5 Jul 2023 17:09:20 +0000 (+0200)
Subject: Use structured binding
X-Git-Tag: relicensing~677^2~7
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=662bed228d125dfeb7945c292d32da2b71781a22;p=dealii.git

Use structured binding
---

diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc
index ece105741a..43185a32f0 100644
--- a/source/grid/grid_tools.cc
+++ b/source/grid/grid_tools.cc
@@ -5968,10 +5968,8 @@ namespace GridTools
           ArborXWrappers::DistributedTree distributed_tree(comm,
                                                            global_bboxes[idx]);
 
-          auto indices_ranks_offset = distributed_tree.query(bb_intersect);
-          auto indices_ranks        = indices_ranks_offset.first;
-          auto offsets              = indices_ranks_offset.second;
-
+          const auto &[indices_ranks, offsets] =
+            distributed_tree.query(bb_intersect);
           fill_ranks_and_indices(offsets, indices_ranks);
         }
       else if constexpr (spacedim == 3)
@@ -5983,10 +5981,8 @@ namespace GridTools
             {
               ArborXWrappers::PointIntersectPredicate bb_intersect(entities);
 
-              auto indices_ranks_offset = distributed_tree.query(bb_intersect);
-              auto indices_ranks        = indices_ranks_offset.first;
-              auto offsets              = indices_ranks_offset.second;
-
+              const auto &[indices_ranks, offsets] =
+                distributed_tree.query(bb_intersect);
               fill_ranks_and_indices(offsets, indices_ranks);
             }
           else if constexpr (std::is_same<T, BoundingBox<3>>::value)
@@ -5994,10 +5990,8 @@ namespace GridTools
               ArborXWrappers::BoundingBoxIntersectPredicate bb_intersect(
                 entities);
 
-              auto indices_ranks_offset = distributed_tree.query(bb_intersect);
-              auto indices_ranks        = indices_ranks_offset.first;
-              auto offsets              = indices_ranks_offset.second;
-
+              const auto &[indices_ranks, offsets] =
+                distributed_tree.query(bb_intersect);
               fill_ranks_and_indices(offsets, indices_ranks);
             }
         }