From b5e979149f88c6961406f794d3da75004a7878ba Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 26 Mar 2004 17:20:19 +0000 Subject: [PATCH] Unconvolute another unnecessarily convoluted loop. Remove two checks that are now no-ops, since the following loops will not be executed at all anyway. git-svn-id: https://svn.dealii.org/trunk@8879 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/dofs/dof_constraints.templates.h | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_constraints.templates.h b/deal.II/deal.II/include/dofs/dof_constraints.templates.h index e05841c5ed..186f25d104 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.templates.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.templates.h @@ -581,10 +581,6 @@ ConstraintMatrix::condense (VectorType &vec) const { Assert (sorted == true, ExcMatrixNotClosed()); - // check if there is anything to do at all - if (lines.size() == 0) - return; - // distribute all entries, and set them to zero std::vector::const_iterator constraint_line = lines.begin(); for (; constraint_line!=lines.end(); ++constraint_line) @@ -605,22 +601,9 @@ ConstraintMatrix::set_zero (VectorType &vec) const { Assert (sorted == true, ExcMatrixNotClosed()); - if (lines.size() == 0) - // nothing to do - return; - - std::vector::const_iterator next_constraint = lines.begin(); - for (unsigned int row=0; rowline) - { - // set entry to zero - vec(row) = 0.; - - ++next_constraint; - if (next_constraint == lines.end()) - // nothing more to do - break; - }; + std::vector::const_iterator constraint_line = lines.begin(); + for (; constraint_line!=lines.end(); ++constraint_line) + vec(constraint_line->line) = 0.; } -- 2.39.5