From: Wolfgang Bangerth Date: Thu, 10 Aug 2017 21:35:51 +0000 (-0600) Subject: Use a clearer way to empty arrays. X-Git-Tag: v9.0.0-rc1~1299^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea4144346a856e0771bf203bd678ed3e634076d3;p=dealii.git Use a clearer way to empty arrays. --- diff --git a/source/hp/dof_handler.cc b/source/hp/dof_handler.cc index 1f296ec5ea..1393169c56 100644 --- a/source/hp/dof_handler.cc +++ b/source/hp/dof_handler.cc @@ -88,8 +88,7 @@ namespace internal std::vector > active_fe_backup(dof_handler.levels.size ()); for (unsigned int level = 0; levelactive_fe_indices, - active_fe_backup[level]); + active_fe_backup[level] = std::move(dof_handler.levels[level]->active_fe_indices); // delete all levels and set them up newly, since vectors // are troublesome if you want to change their size @@ -98,8 +97,7 @@ namespace internal for (unsigned int level=0; leveln_levels(); ++level) { dof_handler.levels.emplace_back (new internal::hp::DoFLevel); - std::swap (active_fe_backup[level], - dof_handler.levels[level]->active_fe_indices); + dof_handler.levels[level]->active_fe_indices = std::move(active_fe_backup[level]); } if (dim > 1) @@ -1648,15 +1646,8 @@ namespace hp levels.clear (); faces.reset (); - { - std::vector tmp; - std::swap (vertex_dofs, tmp); - } - - { - std::vector tmp; - std::swap (vertex_dofs_offsets, tmp); - } + vertex_dofs = std::move(std::vector()); + vertex_dofs_offsets = std::move (std::vector()); } }