chiark / gitweb /
Merge branch 'master' into stable-5.x
[ypp-sc-tools.db-live.git] / yarrg / rssearch.c
index b05a275..1dd29e5 100644 (file)
@@ -111,11 +111,11 @@ static double process_route(int nports, int totaldist,
   }
 
   if (nports>=2) {
-    for (granui=0; granui<granus; granui++) {
-      if (guess[A] > buckets[granui]->prs[A].value[A] ||
-         guess[P] > buckets[granui]->prs[P].value[P])
-       goto not_bucketelim;
-    }
+    for (granui=0; granui<granus; granui++)
+      for (ap=0; ap<AP; ap++)
+       if (guess[ap] > buckets[granui]->prs[ap].value[ap] &&
+           guess[ap] > highscores[granui][ap][0].value)
+         goto not_bucketelim;
     ctr_routes_bucketelim++;
     debugf(" ELIM %f %f\n", guess[A], guess[P]);
     return guess[A];
@@ -156,6 +156,7 @@ static double process_route(int nports, int totaldist,
       } else {
        int pos;
        ctr_newbests_granu[granui*AP+ap]++;
+       bucket->prs[ap].length= totaldist;
        memcpy(bucket->prs[ap].value, value, sizeof(value));
        memcpy(bucket->prs[ap].ports, ports, sizeof(*ports) * nports);
        if (nports < MAX_ROUTELEN-1) bucket->prs[ap].ports[nports]= -1;