Skip to content

Commit 3a2c3ad

Browse files
committed
style(SupportInputImageTypes): Remove nested if in IteratePixelTypes
Simplified the code by combining the conditions of the inner and the outer `if`.
1 parent d890178 commit 3a2c3ad

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

include/itkSupportInputImageTypes.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,13 @@ class SupportInputImageTypes
125125
using ConvertPixelTraits = DefaultConvertPixelTraits<PixelType>;
126126

127127
if (passThrough ||
128-
imageType.componentType == MapComponentType<typename ConvertPixelTraits::ComponentType>::JSONComponentEnum &&
129-
imageType.pixelType == MapPixelType<PixelType>::JSONPixelEnum)
130-
{
131-
if (passThrough || imageType.pixelType == JSONPixelTypesEnum::VariableLengthVector ||
128+
(imageType.componentType == MapComponentType<typename ConvertPixelTraits::ComponentType>::JSONComponentEnum &&
129+
imageType.pixelType == MapPixelType<PixelType>::JSONPixelEnum &&
130+
(imageType.pixelType == JSONPixelTypesEnum::VariableLengthVector ||
132131
imageType.pixelType == JSONPixelTypesEnum::VariableSizeMatrix ||
133-
imageType.components == ConvertPixelTraits::GetNumberOfComponents())
134-
{
135-
return SpecializedImagePipelineFunctor<TPipelineFunctor, Dimension, PixelType>()(pipeline);
136-
}
132+
imageType.components == ConvertPixelTraits::GetNumberOfComponents())))
133+
{
134+
return SpecializedImagePipelineFunctor<TPipelineFunctor, Dimension, PixelType>()(pipeline);
137135
}
138136

139137
if constexpr (sizeof...(TPixelsRest) > 0)

0 commit comments

Comments
 (0)