]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor simplification in particle accessor 12421/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 9 Jun 2021 13:44:33 +0000 (15:44 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 9 Jun 2021 18:46:37 +0000 (20:46 +0200)
include/deal.II/particles/particle_accessor.h

index 855baa9ea0e35ec7021bb8e2ac5c5285e629a0ca..e1f805097bd23362552839c80ca513738e01e745 100644 (file)
@@ -713,7 +713,7 @@ namespace Particles
 
     ++particle_index_within_cell;
 
-    if (particle_index_within_cell > (*particles)[active_cell_index].size() - 1)
+    if (particle_index_within_cell >= (*particles)[active_cell_index].size())
       {
         const bool particle_is_locally_owned = cell->is_locally_owned();
 
@@ -725,7 +725,7 @@ namespace Particles
             ++active_cell_index;
           }
         while (cell.state() == IteratorState::valid &&
-               ((*particles)[active_cell_index].size() == 0 ||
+               ((*particles)[active_cell_index].empty() ||
                 cell->is_locally_owned() != particle_is_locally_owned));
       }
   }

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.