From 9d2364ffb538584d463798ad70849741d9845c2d Mon Sep 17 00:00:00 2001 From: Mihail Isakov Date: Sat, 18 Nov 2023 15:57:23 +0100 Subject: [PATCH] ENH: Fixed coverity warnings in itkImageRegion.h 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; --- Modules/Core/Common/include/itkImageRegion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Core/Common/include/itkImageRegion.h b/Modules/Core/Common/include/itkImageRegion.h index add9284c728..8045eb42fc9 100644 --- a/Modules/Core/Common/include/itkImageRegion.h +++ b/Modules/Core/Common/include/itkImageRegion.h @@ -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) {