From 188a3055c09e7217257b975c9e37371d4f82039a Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Fri, 22 May 2020 13:48:54 +0200 Subject: [PATCH] fix comparators of grids --- alib2graph_data/src/grid/square/SquareGrid4.hpp | 4 ++-- alib2graph_data/src/grid/square/SquareGrid8.hpp | 4 ++-- alib2graph_data/src/grid/square/WeightedSquareGrid4.hpp | 4 ++-- alib2graph_data/src/grid/square/WeightedSquareGrid8.hpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/alib2graph_data/src/grid/square/SquareGrid4.hpp b/alib2graph_data/src/grid/square/SquareGrid4.hpp index 443e2483d3..a193f2a4a3 100644 --- a/alib2graph_data/src/grid/square/SquareGrid4.hpp +++ b/alib2graph_data/src/grid/square/SquareGrid4.hpp @@ -109,8 +109,8 @@ int SquareGrid4<TCoordinate, TEdge>::compare(const GridBase &other) const { template<typename TCoordinate, typename TEdge> int SquareGrid4<TCoordinate, TEdge>::compare(const SquareGrid4 &other) const { auto first = ext::tie(this->m_obstacles, this->m_height, this->m_width); - TCoordinate height = other.getHeight(); - TCoordinate width = other.getWidth(); + const TCoordinate height = other.getHeight(); + const TCoordinate width = other.getWidth(); auto second = ext::tie(other.getObstacleList(), height, width); static ext::compare<decltype(first)> comp; diff --git a/alib2graph_data/src/grid/square/SquareGrid8.hpp b/alib2graph_data/src/grid/square/SquareGrid8.hpp index 4f809c3547..90bd0752f2 100644 --- a/alib2graph_data/src/grid/square/SquareGrid8.hpp +++ b/alib2graph_data/src/grid/square/SquareGrid8.hpp @@ -101,8 +101,8 @@ int SquareGrid8<TCoordinate, TEdge>::compare(const GridBase &other) const { template<typename TCoordinate, typename TEdge> int SquareGrid8<TCoordinate, TEdge>::compare(const SquareGrid8 &other) const { auto first = ext::tie(this->m_obstacles, this->m_height, this->m_width); - TCoordinate height = other.getHeight(); - TCoordinate width = other.getWidth(); + const TCoordinate height = other.getHeight(); + const TCoordinate width = other.getWidth(); auto second = ext::tie(other.getObstacleList(), height, width); static ext::compare<decltype(first)> comp; diff --git a/alib2graph_data/src/grid/square/WeightedSquareGrid4.hpp b/alib2graph_data/src/grid/square/WeightedSquareGrid4.hpp index 7c9906e322..22ea411da3 100644 --- a/alib2graph_data/src/grid/square/WeightedSquareGrid4.hpp +++ b/alib2graph_data/src/grid/square/WeightedSquareGrid4.hpp @@ -133,8 +133,8 @@ int WeightedSquareGrid4<TCoordinate, TEdge>::compare(const GridBase &other) cons template<typename TCoordinate, typename TEdge> int WeightedSquareGrid4<TCoordinate, TEdge>::compare(const WeightedSquareGrid4 &other) const { auto first = ext::tie(this->m_obstacles, this->m_height, this->m_width); - TCoordinate height = other.getHeight(); - TCoordinate width = other.getWidth(); + const TCoordinate height = other.getHeight(); + const TCoordinate width = other.getWidth(); auto second = ext::tie(other.getObstacleList(), height, width); static ext::compare<decltype(first)> comp; diff --git a/alib2graph_data/src/grid/square/WeightedSquareGrid8.hpp b/alib2graph_data/src/grid/square/WeightedSquareGrid8.hpp index 5a63aca7ec..a93bdb610d 100644 --- a/alib2graph_data/src/grid/square/WeightedSquareGrid8.hpp +++ b/alib2graph_data/src/grid/square/WeightedSquareGrid8.hpp @@ -133,8 +133,8 @@ int WeightedSquareGrid8<TCoordinate, TEdge>::compare(const GridBase &other) cons template<typename TCoordinate, typename TEdge> int WeightedSquareGrid8<TCoordinate, TEdge>::compare(const WeightedSquareGrid8 &other) const { auto first = ext::tie(this->m_obstacles, this->m_height, this->m_width); - TCoordinate height = other.getHeight(); - TCoordinate width = other.getWidth(); + const TCoordinate height = other.getHeight(); + const TCoordinate width = other.getWidth(); auto second = ext::tie(other.getObstacleList(), height, width); static ext::compare<decltype(first)> comp; -- GitLab