From 3123c4025167a1bcd00173e10ba206ead8dd3901 Mon Sep 17 00:00:00 2001 From: Wojciech Mamrak Date: Mon, 20 May 2024 13:43:56 +0200 Subject: [PATCH] Remove redundant operations from PathCost private constructor. --- include/central64/grid/PathCost.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/central64/grid/PathCost.hpp b/include/central64/grid/PathCost.hpp index 21fca0c..f9381f6 100644 --- a/include/central64/grid/PathCost.hpp +++ b/include/central64/grid/PathCost.hpp @@ -62,10 +62,9 @@ constexpr PathCost::PathCost(double distance) } constexpr PathCost::PathCost(int64_t multiplier, int) - : multiplier_{ (multiplier >= 0) ? (multiplier >= max) ? max : - int64_t(multiplier + 0.5) : - (multiplier <= -max) ? -max : - -int64_t(-multiplier + 0.5) } + : multiplier_{ (multiplier >= max) ? max : + (multiplier <= -max) ? -max : + multiplier } { }