From 2591e276b5b4e4f325b0fe2dd822c0ce28ab1f16 Mon Sep 17 00:00:00 2001
From: bangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Mon, 28 Oct 2013 13:23:58 +0000
Subject: [PATCH] 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
---
 deal.II/source/grid/tria_objects.cc | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

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<G::dimension>::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(),
-- 
2.39.5