From 826e36c5708c0bc7c90786bf810d2dd194e34fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Bohl?= Date: Thu, 12 Dec 2024 17:20:42 +0100 Subject: [PATCH] Simplify return statements with brace-enclosed initializer Simplified the return statements in two conditional blocks by removing the explicit type `libCZI::IntPointAndFrameOfReference` and using the brace-enclosed initializer list directly. This change makes the code more concise and leverages the compiler's ability to deduce the return type. --- Src/libCZI/CZIReader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/libCZI/CZIReader.cpp b/Src/libCZI/CZIReader.cpp index 06015f65..2f6cccc4 100644 --- a/Src/libCZI/CZIReader.cpp +++ b/Src/libCZI/CZIReader.cpp @@ -146,14 +146,14 @@ CCZIReader::CCZIReader() : isOperational(false), default_frame_of_reference(CZIF destination_frame_of_reference_consolidated == CZIFrameOfReference::RawSubBlockCoordinateSystem) { const auto& statistics = this->subBlkDir.GetStatistics(); - return libCZI::IntPointAndFrameOfReference{ CZIFrameOfReference::RawSubBlockCoordinateSystem, {source_point.point.x + statistics.boundingBoxLayer0Only.x, source_point.point.y + statistics.boundingBoxLayer0Only.y} }; + return { CZIFrameOfReference::RawSubBlockCoordinateSystem, {source_point.point.x + statistics.boundingBoxLayer0Only.x, source_point.point.y + statistics.boundingBoxLayer0Only.y} }; } if (source_frame_of_reference_consolidated == CZIFrameOfReference::RawSubBlockCoordinateSystem && destination_frame_of_reference_consolidated == CZIFrameOfReference::PixelCoordinateSystem) { const auto& statistics = this->subBlkDir.GetStatistics(); - return libCZI::IntPointAndFrameOfReference{ CZIFrameOfReference::PixelCoordinateSystem, {source_point.point.x - statistics.boundingBoxLayer0Only.x, source_point.point.y - statistics.boundingBoxLayer0Only.y} }; + return { CZIFrameOfReference::PixelCoordinateSystem, {source_point.point.x - statistics.boundingBoxLayer0Only.x, source_point.point.y - statistics.boundingBoxLayer0Only.y} }; } throw logic_error("Unsupported frame-of-reference transformation.");