From fbafbe59c106729537c42438bf55e945750d7b88 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 6 Apr 2023 17:17:50 -0600 Subject: [PATCH] Simplify code slightly. Avoid using a second counter in a range-based for loop, which always looks a bit awkward. --- source/grid/grid_tools_cache.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/grid/grid_tools_cache.cc b/source/grid/grid_tools_cache.cc index 4caa9a671a..596959ef69 100644 --- a/source/grid/grid_tools_cache.cc +++ b/source/grid/grid_tools_cache.cc @@ -130,10 +130,10 @@ namespace GridTools std::vector, typename Triangulation::active_cell_iterator>> - boxes(tria->n_active_cells()); - unsigned int i = 0; + boxes; + boxes.reserve(tria->n_active_cells()); for (const auto &cell : tria->active_cell_iterators()) - boxes[i++] = std::make_pair(mapping->get_bounding_box(cell), cell); + boxes.emplace_back(mapping->get_bounding_box(cell), cell); cell_bounding_boxes_rtree = pack_rtree(boxes); update_flags = update_flags & ~update_cell_bounding_boxes_rtree; -- 2.39.5