From 4f14b2b998359c4a4fe5c36e25999134deac0578 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 18 May 2020 17:07:41 -0600 Subject: [PATCH] Simplify a piece of code. --- examples/step-70/step-70.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/step-70/step-70.cc b/examples/step-70/step-70.cc index 4dd8a1917d..bf3a698e71 100644 --- a/examples/step-70/step-70.cc +++ b/examples/step-70/step-70.cc @@ -896,14 +896,12 @@ namespace Step70 // We construct this information by first building an index tree of boxes // bounding the locally owned cells, and then extracting one of the first // levels of the tree: - std::vector> all_boxes( - fluid_tria.n_locally_owned_active_cells()); - unsigned int i = 0; + std::vector> all_boxes; + all_boxes.reserve(fluid_tria.n_locally_owned_active_cells()); for (const auto cell : fluid_tria.active_cell_iterators()) if (cell->is_locally_owned()) - all_boxes[i++] = cell->bounding_box(); + all_boxes.emplace_back(cell->bounding_box()); - // We construct the tree const auto tree = pack_rtree(all_boxes); // extract the desired level -- 2.39.5