]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Unconvolute another unnecessarily convoluted loop.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 26 Mar 2004 17:20:19 +0000 (17:20 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 26 Mar 2004 17:20:19 +0000 (17:20 +0000)
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

deal.II/deal.II/include/dofs/dof_constraints.templates.h

index e05841c5edcca484c131b079a4b224fcbd296171..186f25d104e6a6c9b2564bee40341062df0e8954 100644 (file)
@@ -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<ConstraintLine>::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<ConstraintLine>::const_iterator next_constraint = lines.begin();
-  for (unsigned int row=0; row<vec.size(); ++row)
-    if (row == next_constraint->line)
-      {
-                                        // set entry to zero
-       vec(row) = 0.;
-       
-       ++next_constraint;
-       if (next_constraint == lines.end())
-                                          // nothing more to do
-         break;
-      };
+  std::vector<ConstraintLine>::const_iterator constraint_line = lines.begin();
+  for (; constraint_line!=lines.end(); ++constraint_line)
+    vec(constraint_line->line) = 0.;
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.