Skip to content

Commit

Permalink
STYLE: Replace default capture ParallelizeImageRegionRestrictDirection
Browse files Browse the repository at this point in the history
Instead of capturing everything by reference (by default capture `&`), captured
the parameter `restrictedDirection` by value. `restrictedDirection` is
lightweight (it's an `unsigned int`), and it is not modified by the lambda,
so there is no reason to capture it by reference.
  • Loading branch information
N-Dekker authored and hjmjohnson committed Dec 17, 2023
1 parent e04d4c2 commit f9d21ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkMultiThreaderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ ITK_GCC_PRAGMA_DIAG_POP()
SplitDimension,
splitIndex.m_InternalArray,
splitSize.m_InternalArray,
[&](const IndexValueType index[], const SizeValueType size[]) {
[restrictedDirection, &requestedRegion, &funcP](const IndexValueType index[], const SizeValueType size[]) {
ImageRegion<VDimension> restrictedRequestedRegion;
restrictedRequestedRegion.SetIndex(restrictedDirection, requestedRegion.GetIndex(restrictedDirection));
restrictedRequestedRegion.SetSize(restrictedDirection, requestedRegion.GetSize(restrictedDirection));
Expand Down

0 comments on commit f9d21ae

Please sign in to comment.