Skip to content

Commit

Permalink
STYLE: Remove continue from ParallelizeImageRegionRestrictDirection
Browse files Browse the repository at this point in the history
Following C++ Core Guidelines, October 12, 2023, "Minimize the use of `break`
and `continue` in loops",
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es77-minimize-the-use-of-break-and-continue-in-loops
  • Loading branch information
N-Dekker authored and hjmjohnson committed Dec 17, 2023
1 parent dd93015 commit 620b592
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Modules/Core/Common/include/itkMultiThreaderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,12 @@ ITK_GCC_PRAGMA_DIAG_POP()
SplitRegionType splitRegion;
for (unsigned int splitDimension = 0, dimension = 0; dimension < VDimension; ++dimension)
{
if (dimension == restrictedDirection)
if (dimension != restrictedDirection)
{
continue;
splitRegion.SetIndex(splitDimension, requestedRegion.GetIndex(dimension));
splitRegion.SetSize(splitDimension, requestedRegion.GetSize(dimension));
++splitDimension;
}
splitRegion.SetIndex(splitDimension, requestedRegion.GetIndex(dimension));
splitRegion.SetSize(splitDimension, requestedRegion.GetSize(dimension));
++splitDimension;
}

this->ParallelizeImageRegion(
Expand All @@ -397,13 +396,12 @@ ITK_GCC_PRAGMA_DIAG_POP()
restrictedRequestedRegion.SetSize(restrictedDirection, requestedRegion.GetSize(restrictedDirection));
for (unsigned int splitDimension = 0, dimension = 0; dimension < VDimension; ++dimension)
{
if (dimension == restrictedDirection)
if (dimension != restrictedDirection)
{
continue;
restrictedRequestedRegion.SetIndex(dimension, index[splitDimension]);
restrictedRequestedRegion.SetSize(dimension, size[splitDimension]);
++splitDimension;
}
restrictedRequestedRegion.SetIndex(dimension, index[splitDimension]);
restrictedRequestedRegion.SetSize(dimension, size[splitDimension]);
++splitDimension;
}
funcP(restrictedRequestedRegion);
},
Expand Down

0 comments on commit 620b592

Please sign in to comment.