Minor if-else simplification

This commit is contained in:
Jan Potocki
2020-01-20 19:19:01 +01:00
parent 4292c63a15
commit 01f2e91aac
+1 -8
View File
@@ -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;