Skip to content

Commit

Permalink
STYLE: Use MakeFilled in Filled member functions FixedArray, Index, Size
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Dekker authored and hjmjohnson committed Mar 7, 2022
1 parent b7715b3 commit b836eb1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
8 changes: 2 additions & 6 deletions Modules/Core/Common/include/itkFixedArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define itkFixedArray_h

#include "itkMacro.h"
#include "itkMakeFilled.h"
#include <algorithm>
#include <array>

Expand Down Expand Up @@ -423,12 +424,7 @@ class ITK_TEMPLATE_EXPORT FixedArray
static constexpr FixedArray
Filled(const ValueType & value)
{
FixedArray result{};
for (ValueType & element : result.m_InternalArray)
{
element = value;
}
return result;
return MakeFilled<FixedArray>(value);
}
};

Expand Down
8 changes: 2 additions & 6 deletions Modules/Core/Common/include/itkIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef itkIndex_h
#define itkIndex_h

#include "itkMakeFilled.h"
#include "itkOffset.h"
#include <type_traits> // For is_integral.

Expand Down Expand Up @@ -484,12 +485,7 @@ struct ITK_TEMPLATE_EXPORT Index final
static constexpr Self
Filled(const IndexValueType value)
{
Self result{};
for (IndexValueType & indexValue : result.m_InternalArray)
{
indexValue = value;
}
return result;
return MakeFilled<Self>(value);
}


Expand Down
8 changes: 2 additions & 6 deletions Modules/Core/Common/include/itkSize.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "itkIntTypes.h"
#include "itkMacro.h"
#include "itkMakeFilled.h"
#include <algorithm> // For copy_n.
#include <type_traits> // For is_integral.
#include <memory>
Expand Down Expand Up @@ -406,12 +407,7 @@ struct ITK_TEMPLATE_EXPORT Size final
static constexpr Self
Filled(const SizeValueType value)
{
Self result{};
for (SizeValueType & sizeValue : result.m_InternalArray)
{
sizeValue = value;
}
return result;
return MakeFilled<Self>(value);
}

}; //------------ End struct Size
Expand Down

0 comments on commit b836eb1

Please sign in to comment.