Skip to content

Commit

Permalink
ENH: Fixed coverity warnings in itkImageRegion.h
Browse files Browse the repository at this point in the history
Coverity 2023.6.2:

275       bool
276       IsInside(const Self & otherRegion) const
277       {
>>>     CID 331225:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>     Using the "auto" keyword without an "&" causes the copy of an object of type "itk::ImageRegion<3u>::IndexType".
278         const auto otherIndex = otherRegion.m_Index;

275       bool
276       IsInside(const Self & otherRegion) const
277       {
278         const auto otherIndex = otherRegion.m_Index;
>>>     CID 331206:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>     Using the "auto" keyword without an "&" causes the copy of an object of type "itk::ImageRegion<3u>::SizeType".
279         const auto otherSize = otherRegion.m_Size;
  • Loading branch information
issakomi authored and N-Dekker committed Nov 22, 2023
1 parent 4b40075 commit 9d2364f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkImageRegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ class ITK_TEMPLATE_EXPORT ImageRegion final : public Region
bool
IsInside(const Self & otherRegion) const
{
const auto otherIndex = otherRegion.m_Index;
const auto otherSize = otherRegion.m_Size;
const auto & otherIndex = otherRegion.m_Index;
const auto & otherSize = otherRegion.m_Size;

for (unsigned int i = 0; i < ImageDimension; ++i)
{
Expand Down

0 comments on commit 9d2364f

Please sign in to comment.