From 01f2e91aacbd896b19b61a9e43cad27ef9f21e8e Mon Sep 17 00:00:00 2001 From: Jan Potocki Date: Mon, 20 Jan 2020 19:19:01 +0100 Subject: [PATCH] Minor if-else simplification --- Graph.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Graph.cpp b/Graph.cpp index f397008..19c7fc7 100755 --- a/Graph.cpp +++ b/Graph.cpp @@ -565,14 +565,7 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps, // ...jezeli niespelnione - pomijamy ruch continue; - if(nextRouteLength == -1) - { - nextRouteLength = neighbourRouteLength; - nextRoute = neighbourRoute; - nextTabu.at(1) = i; - nextTabu.at(2) = j; - } - else if(nextRouteLength > neighbourRouteLength) + if(nextRouteLength == -1 || nextRouteLength > neighbourRouteLength) { nextRouteLength = neighbourRouteLength; nextRoute = neighbourRoute;