Browse Source

Minor if-else simplification

Jan Potocki 5 years ago
parent
commit
01f2e91aac
1 changed files with 1 additions and 8 deletions
  1. 1
    8
      Graph.cpp

+ 1
- 8
Graph.cpp View File

565
                         // ...jezeli niespelnione - pomijamy ruch
565
                         // ...jezeli niespelnione - pomijamy ruch
566
                         continue;
566
                         continue;
567
 
567
 
568
-                    if(nextRouteLength == -1)
568
+                    if(nextRouteLength == -1 || nextRouteLength > neighbourRouteLength)
569
-                    {
570
-                        nextRouteLength = neighbourRouteLength;
571
-                        nextRoute = neighbourRoute;
572
-                        nextTabu.at(1) = i;
573
-                        nextTabu.at(2) = j;
574
-                    }
575
-                    else if(nextRouteLength > neighbourRouteLength)
576
                     {
569
                     {
577
                         nextRouteLength = neighbourRouteLength;
570
                         nextRouteLength = neighbourRouteLength;
578
                         nextRoute = neighbourRoute;
571
                         nextRoute = neighbourRoute;

Loading…
Cancel
Save