From: Joey Hess Date: Fri, 14 Aug 2009 04:51:52 +0000 (-0400) Subject: orphans: Reuse backlinks info X-Git-Tag: 3.1415926~132 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/f486271009142ec7e04e1a62c1e94ad9e51b6d39?hp=-c orphans: Reuse backlinks info This plugin was building essentially the same data that is built to handle backlinks, so reuse that as an optimisation. --- f486271009142ec7e04e1a62c1e94ad9e51b6d39 diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 02f5d2524..711226772 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -27,15 +27,9 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my %linkedto; - foreach my $p (keys %links) { - map { $linkedto{bestlink($p, $_)}=1 if length $_ } - @{$links{$p}}; - } - my @orphans; foreach my $page (pagespec_match_list( - [ grep { ! $linkedto{$_} && $_ ne 'index' } + [ grep { ! IkiWiki::backlink_pages($_) && $_ ne 'index' } keys %pagesources ], $params{pages}, location => $params{page})) { # If the page has a link to some other page, it's