From: Robert Fitzsimons Date: Fri, 22 Dec 2006 19:38:14 +0000 (+0000) Subject: gitweb: optimize git_shortlog_body. X-Git-Tag: v1.5.0-rc0~25 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3fcf06be5d02de15992d11482cfae82dc058261b;p=git.git gitweb: optimize git_shortlog_body. Don't call gitweb_have_snapshot from within the loop. Signed-off-by: Robert Fitzsimons Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 01e3a8ada..d2ddac8bf 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2636,6 +2636,8 @@ sub git_shortlog_body { # uses global variable $project my ($revlist, $from, $to, $refs, $extra) = @_; + my $have_snapshot = gitweb_have_snapshot(); + $from = 0 unless defined $from; $to = $#{$revlist} if (!defined $to || $#{$revlist} < $to); @@ -2663,7 +2665,7 @@ sub git_shortlog_body { $cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " . $cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree"); - if (gitweb_have_snapshot()) { + if ($have_snapshot) { print " | " . $cgi->a({-href => href(action=>"snapshot", hash=>$commit)}, "snapshot"); } print "\n" .