From: Wolfgang Bangerth Date: Sun, 18 Jun 2017 01:18:55 +0000 (-0600) Subject: Make control flow more obvious. X-Git-Tag: v9.0.0-rc1~1487^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1096353c171c350807d7deb154fec66caecb0ebc;p=dealii.git Make control flow more obvious. --- diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 32d36747ce..a8faedbd54 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -1557,18 +1557,18 @@ void DoFHandler::MGVertexDoFs::init (const unsigned int cl, coarsest_level = cl; finest_level = fl; - if (cl > fl) - return; - - const unsigned int n_levels = finest_level - coarsest_level + 1; - const unsigned int n_indices = n_levels * dofs_per_vertex; + if (coarsest_level <= finest_level) + { + const unsigned int n_levels = finest_level - coarsest_level + 1; + const unsigned int n_indices = n_levels * dofs_per_vertex; - indices = new types::global_dof_index[n_indices]; - std::fill (indices, indices+n_indices, DoFHandler::invalid_dof_index); + indices = new types::global_dof_index[n_indices]; + std::fill (indices, indices+n_indices, DoFHandler::invalid_dof_index); - indices_offset = new types::global_dof_index[n_levels]; - for (unsigned int i = 0; i < n_levels; ++i) - indices_offset[i] = i * dofs_per_vertex; + indices_offset = new types::global_dof_index[n_levels]; + for (unsigned int i = 0; i < n_levels; ++i) + indices_offset[i] = i * dofs_per_vertex; + } }