minor optimisation
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 2 Oct 2009 19:41:09 +0000 (15:41 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 2 Oct 2009 19:41:09 +0000 (15:41 -0400)
As soon as a change happens, we know we will need to rescan all
dependencies from the start, so bail out of the current scan partway to
avoid doing redundant work.

Only problem with this is that ikiwiki sometimes ends up printing out
dependencies that, while correct, are not obvious. Before:

building B, which depends on A
building C, which depends on A
building D, which depends on A

After:

building B, which depends on A
building C, which depends on B
building D, which depends on C

IkiWiki/Render.pm

index c58f33d68450bb3ab16249225204f92dd572116a..09b646f75f0c1be520355b6beacc409ad119c086 100644 (file)
@@ -501,6 +501,7 @@ sub refresh () {
                                        render($f);
                                        $rendered{$f}=1;
                                        $changes++;
+                                       last;
                                }
                        }
                } while $changes;