chiark / gitweb /
routesearch: Use correct island pair when eliminating!
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 4 Oct 2009 23:56:14 +0000 (00:56 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 4 Oct 2009 23:56:14 +0000 (00:56 +0100)
yarrg/rssearch.c

index 9404cb2..d5a97a4 100644 (file)
@@ -53,7 +53,7 @@ static double process_route(int nports, int totaldist,
     
     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]);