From: Wolfgang Bangerth Date: Wed, 28 Aug 2024 15:51:05 +0000 (-0600) Subject: Reserve the necessary amount of space. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17624%2Fhead;p=dealii.git Reserve the necessary amount of space. --- diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index d9ca0f1ff2..b95bf0c216 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -446,6 +446,7 @@ namespace internal IndexSet constrained_indices(locally_owned_dofs.size()); std::vector constrained_indices_temp; + constrained_indices_temp.reserve(constraints_in.n_constraints()); for (const auto &line : constraints_in.get_lines()) constrained_indices_temp.push_back(line.index); std::sort(constrained_indices_temp.begin(), constrained_indices_temp.end());