inline: Minor optimisation.

When finding the pageurl, it was calling bestlink unnecessarily.
Since at this point $page contains the full name of the page that
is being inlined, there is no need to do bestlink's scan
for it.

This is only a minor optimisation, since bestlink is only called
once per displayed, inlined page.
master
Joey Hess 2009-05-05 20:06:50 -04:00
parent ad2f1805a9
commit e77d0030d6
2 changed files with 2 additions and 1 deletions

View File

@ -342,7 +342,7 @@ sub preprocess_inline (@) {
my $content=get_inline_content($page, $params{destpage}); my $content=get_inline_content($page, $params{destpage});
$template->param(content => $content); $template->param(content => $content);
} }
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage})); $template->param(pageurl => urlto($page, $params{destpage}));
$template->param(inlinepage => $page); $template->param(inlinepage => $page);
$template->param(title => pagetitle(basename($page))); $template->param(title => pagetitle(basename($page)));
$template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));

1
debian/changelog vendored
View File

@ -4,6 +4,7 @@ ikiwiki (3.12) UNRELEASED; urgency=low
* ikiwiki-makerepo: Avoid using abs_path, as it apparently * ikiwiki-makerepo: Avoid using abs_path, as it apparently
fails on nonexistant directories with some broken perl fails on nonexistant directories with some broken perl
versions. versions.
* inline: Minor optimisation.
-- Joey Hess <joeyh@debian.org> Mon, 04 May 2009 19:17:39 -0400 -- Joey Hess <joeyh@debian.org> Mon, 04 May 2009 19:17:39 -0400