From: Wolfgang Bangerth Date: Sat, 15 Feb 2020 05:28:16 +0000 (-0700) Subject: Avoid nonlocal control flow since it's so hard to read. X-Git-Tag: v9.2.0-rc1~516^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9536%2Fhead;p=dealii.git Avoid nonlocal control flow since it's so hard to read. --- diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index e6a026aa81..9e0f9f3311 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -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; } } }