]> sipb.mit.edu Git - ikiwiki.git/commitdiff
slight optimisation
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 16 Oct 2009 00:01:47 +0000 (20:01 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 16 Oct 2009 00:01:47 +0000 (20:01 -0400)
IkiWiki/Plugin/inline.pm

index 553fd350c15dd173305d52da5e9b9c2e85be332a..a836c18f41c9466a647b58149d04d05f889cb4e7 100644 (file)
@@ -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.