chiark / gitweb /
routesearch: Use correct island pair when eliminating!
[ypp-sc-tools.web-live.git] / yarrg / rssearch.c
index 9404cb2619e764e9d914b7872d1e34589a05d67a..d5a97a488604fb74db3f5c6ceaa7c686ef2613ed 100644 (file)
@@ -53,7 +53,7 @@ static double process_route(int nports, int totaldist,
     
     for (i=0; i<nports; i++) {
       pair[0]= ports[i];
     
     for (i=0; i<nports; i++) {
       pair[0]= ports[i];
-      IslandPair *ip= ipair_get_maybe(ports[nports-2], ports[nports-1]);
+      IslandPair *ip= ipair_get_maybe(pair[0], pair[1]);
       if (!ip) continue;
       if (ip->route_tail_value < 0)
        ip->route_tail_value= value_route(2, pair, pair[0]!=pair[1]);
       if (!ip) continue;
       if (ip->route_tail_value < 0)
        ip->route_tail_value= value_route(2, pair, pair[0]!=pair[1]);