]> sipb.mit.edu Git - ikiwiki.git/commitdiff
inline: if using pagenames, don't add a dependency on "page1 or page2 or..."
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Thu, 27 Aug 2009 22:30:41 +0000 (23:30 +0100)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Fri, 28 Aug 2009 14:34:35 +0000 (15:34 +0100)
This is unnecessary and just slows us down (by a factor of 2, in the
pessimal case where every page has an inline with pagenames); it's also
not possible to optimize it into add_depends_exact calls.

IkiWiki/Plugin/inline.pm

index a501566b554d11cd1894878637aaf5d2204089d4..d5ad11d438ce2b4b43a9d913cdf489ec0d34e779 100644 (file)
@@ -195,10 +195,10 @@ sub preprocess_inline (@) {
 
                @list = map { bestlink($params{page}, $_) }
                        split ' ', $params{pagenames};
 
                @list = map { bestlink($params{page}, $_) }
                        split ' ', $params{pagenames};
-
-               $params{pages} = join(" or ", @list);
        }
        else {
        }
        else {
+               add_depends($params{page}, $params{pages});
+
                @list = pagespec_match_list(
                        [ grep { $_ ne $params{page} } keys %pagesources ],
                        $params{pages}, location => $params{page});
                @list = pagespec_match_list(
                        [ grep { $_ ne $params{page} } keys %pagesources ],
                        $params{pages}, location => $params{page});
@@ -247,7 +247,6 @@ sub preprocess_inline (@) {
                @list=@list[0..$params{show} - 1];
        }
 
                @list=@list[0..$params{show} - 1];
        }
 
-       add_depends($params{page}, $params{pages});
        # Explicitly add all currently displayed pages as dependencies, so
        # that if they are removed or otherwise changed, the inline will be
        # sure to be updated.
        # Explicitly add all currently displayed pages as dependencies, so
        # that if they are removed or otherwise changed, the inline will be
        # sure to be updated.