]> git.pond.sub.org Git - empserver/commitdiff
Optimize dodistribute() for sectors with no distribution center
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 25 Feb 2011 07:08:05 +0000 (08:08 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 11 Apr 2011 20:29:13 +0000 (22:29 +0200)
import_cost is now -1 in that case, so checking that suffices.

src/lib/update/distribute.c

index 7e94812cd393e306ef11ec3ada2dcc579795057f..62a6273ca68e4fdd6deee228ffca80ec0777d2df 100644 (file)
@@ -70,9 +70,6 @@ dodistribute(struct sctstr *sp, int imex, double import_cost)
     int rplague;
     int lplague;
 
     int rplague;
     int lplague;
 
-    if ((sp->sct_dist_x == sp->sct_x) && (sp->sct_dist_y == sp->sct_y))
-       return 0;
-
     if (imex == IMPORT && import_cost < 0.0)
        return 0;
 
     if (imex == IMPORT && import_cost < 0.0)
        return 0;
 
@@ -82,7 +79,7 @@ dodistribute(struct sctstr *sp, int imex, double import_cost)
     else {
        dcc = sector_mcost(dist, MOB_MOVE);
        if (import_cost < 0.0 || dcc < 0.0) {
     else {
        dcc = sector_mcost(dist, MOB_MOVE);
        if (import_cost < 0.0 || dcc < 0.0) {
-           if (sp->sct_own != 0)
+           if (sp->sct_own && sp->sct_uid != dist->sct_uid)
                wu(0, sp->sct_own, "No path to dist sector for %s\n",
                   ownxy(sp));
            return 0;
                wu(0, sp->sct_own, "No path to dist sector for %s\n",
                   ownxy(sp));
            return 0;