From: bangerth Date: Mon, 28 Oct 2013 13:23:58 +0000 (+0000) Subject: Be less circumspect about resizing arrays when we want to add X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2591e276b5b4e4f325b0fe2dd822c0ce28ab1f16;p=dealii-svn.git Be less circumspect about resizing arrays when we want to add default-constructed elements. git-svn-id: https://svn.dealii.org/trunk@31464 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/grid/tria_objects.cc b/deal.II/source/grid/tria_objects.cc index c153febdc1..d73503bac4 100644 --- a/deal.II/source/grid/tria_objects.cc +++ b/deal.II/source/grid/tria_objects.cc @@ -192,15 +192,8 @@ namespace internal RefinementCase::no_refinement); } - boundary_or_material_id.reserve (new_size); - boundary_or_material_id.insert (boundary_or_material_id.end(), - new_size-boundary_or_material_id.size(), - BoundaryOrMaterialId()); - - user_data.reserve (new_size); - user_data.insert (user_data.end(), - new_size-user_data.size(), - UserData()); + boundary_or_material_id.resize (new_size); + user_data.resize (new_size); } if (n_unused_singles==0) @@ -272,15 +265,8 @@ namespace internal 4*new_size-children.size(), -1); - boundary_or_material_id.reserve (new_size); - boundary_or_material_id.insert (boundary_or_material_id.end(), - new_size-boundary_or_material_id.size(), - BoundaryOrMaterialId()); - - user_data.reserve (new_size); - user_data.insert (user_data.end(), - new_size-user_data.size(), - UserData()); + boundary_or_material_id.resize (new_size); + user_data.resize (new_size); face_orientations.reserve (new_size * GeometryInfo<3>::faces_per_cell); face_orientations.insert (face_orientations.end(),