]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use a range-based for loop. 7878/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 30 Mar 2019 14:57:31 +0000 (08:57 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 30 Mar 2019 14:57:31 +0000 (08:57 -0600)
source/hp/dof_handler.cc

index 307dd6015194904ffb862561f1eb9730410c33be..6bfa72ddee6a405fcad49c9c52dac48f4c48798c 100644 (file)
@@ -1222,8 +1222,8 @@ namespace hp
   {
     // unsubscribe as a listener to refinement of the underlying
     // triangulation
-    for (unsigned int i = 0; i < tria_listeners.size(); ++i)
-      tria_listeners[i].disconnect();
+    for (auto &connection : tria_listeners)
+      connection.disconnect();
     tria_listeners.clear();
 
     // ...and release allocated memory
@@ -1514,8 +1514,8 @@ namespace hp
   {
     if (this->tria != &tria)
       {
-        for (unsigned int i = 0; i < tria_listeners.size(); ++i)
-          tria_listeners[i].disconnect();
+        for (auto &connection : tria_listeners)
+          connection.disconnect();
         tria_listeners.clear();
 
         this->tria = &tria;

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.