]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Optimised file statting code when scanning for modified pages; cut the number of...
[ikiwiki.git] / IkiWiki.pm
index 98145a585efda00b7110db7762b3be7106c169c9..88407584fbf7f8f2b3c51de7a6cfd16df57626be 100644 (file)
@@ -282,18 +282,22 @@ sub htmlpage ($) { #{{{
        return targetpage($page, $config{htmlext});
 } #}}}
 
-sub srcfile ($;$) { #{{{
+sub srcfile_stat { #{{{
        my $file=shift;
        my $nothrow=shift;
 
-       return "$config{srcdir}/$file" if -e "$config{srcdir}/$file";
+       return "$config{srcdir}/$file", stat(_) if -e "$config{srcdir}/$file";
        foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) {
-               return "$dir/$file" if -e "$dir/$file";
+               return "$dir/$file", stat(_) if -e "$dir/$file";
        }
        error("internal error: $file cannot be found in $config{srcdir} or underlay") unless $nothrow;
        return;
 } #}}}
 
+sub srcfile ($;$) { #{{{
+       return (srcfile_stat(@_))[0];
+} #}}}
+
 sub add_underlay ($) { #{{{
        my $dir=shift;