ソースを参照

Minor if-else simplification

Jan Potocki 5年前
コミット
01f2e91aac
1個のファイルの変更1行の追加8行の削除
  1. 1
    8
      Graph.cpp

+ 1
- 8
Graph.cpp ファイルの表示

@@ -565,14 +565,7 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
565 565
                         // ...jezeli niespelnione - pomijamy ruch
566 566
                         continue;
567 567
 
568
-                    if(nextRouteLength == -1)
569
-                    {
570
-                        nextRouteLength = neighbourRouteLength;
571
-                        nextRoute = neighbourRoute;
572
-                        nextTabu.at(1) = i;
573
-                        nextTabu.at(2) = j;
574
-                    }
575
-                    else if(nextRouteLength > neighbourRouteLength)
568
+                    if(nextRouteLength == -1 || nextRouteLength > neighbourRouteLength)
576 569
                     {
577 570
                         nextRouteLength = neighbourRouteLength;
578 571
                         nextRoute = neighbourRoute;

読み込み中…
キャンセル
保存