From: Joey Hess Date: Fri, 16 Oct 2009 00:01:47 +0000 (-0400) Subject: slight optimisation X-Git-Tag: 3.20091017~13 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/fc1bad2e7b6922205ad079043fe3057b3628a2a8 slight optimisation --- diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 553fd350c..a836c18f4 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -332,13 +332,13 @@ sub preprocess_inline (@) { error sprintf(gettext("nonexistant template %s"), $params{template}); } my $template=HTML::Template->new(@params) unless $raw; + my $needcontent=!($archive && $quick) && $template->query(name => 'content'); foreach my $page (@list) { my $file = $pagesources{$page}; my $type = pagetype($file); if (! $raw || ($raw && ! defined $type)) { - if (!($archive && $quick) && - $template->query(name => 'content')) { + if ($needcontent) { # Get the content before populating the # template, since getting the content uses # the same template if inlines are nested.