]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid nonlocal control flow since it's so hard to read. 9536/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 15 Feb 2020 05:28:16 +0000 (22:28 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 15 Feb 2020 05:28:16 +0000 (22:28 -0700)
source/multigrid/mg_transfer_internal.cc

index e6a026aa812c1f450ce6dbe070ef582459a36e25..9e0f9f33111fd77734e8cb1d58705c173d09793c 100644 (file)
@@ -167,27 +167,27 @@ namespace internal
                         globally_relevant.index_within_set(
                           global_dof_indices[i]);
 
-                      // skip if we did this global dof already (on this or a
+                      // Work on this dof if we haven't already (on this or a
                       // coarser level)
-                      if (dof_touched[relevant_idx])
-                        continue;
-
-                      if (global_mine)
-                        {
-                          copy_indices_global_mine[level].emplace_back(
-                            global_dof_indices[i], level_dof_indices[i]);
-
-                          // send this to the owner of the level_dof:
-                          send_data_temp.emplace_back(level,
-                                                      global_dof_indices[i],
-                                                      level_dof_indices[i]);
-                        }
-                      else
+                      if (dof_touched[relevant_idx] == false)
                         {
-                          // somebody will send those to me
+                          if (global_mine)
+                            {
+                              copy_indices_global_mine[level].emplace_back(
+                                global_dof_indices[i], level_dof_indices[i]);
+
+                              // send this to the owner of the level_dof:
+                              send_data_temp.emplace_back(level,
+                                                          global_dof_indices[i],
+                                                          level_dof_indices[i]);
+                            }
+                          else
+                            {
+                              // somebody will send those to me
+                            }
+
+                          dof_touched[relevant_idx] = true;
                         }
-
-                      dof_touched[relevant_idx] = true;
                     }
                 }
             }

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.