From: Wolfgang Bangerth Date: Mon, 18 May 2020 23:07:41 +0000 (-0600) Subject: Simplify a piece of code. X-Git-Tag: v9.3.0-rc1~1613^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=947c65c6dae3348666a8528058040eae4be2385c;p=dealii.git Simplify a piece of code. --- 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