gitweb: optimize git_shortlog_body.
Don't call gitweb_have_snapshot from within the loop. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Robert Fitzsimons committed
Dec 22, 2006 at 19:38 UTC
3fcf06be5d02de15992d11482cfae82dc058261b
1 file changed
+3
-1
gitweb/gitweb.perl
+3
-1
@@ -2636,6 +2636,8 @@ sub git_shortlog_body {
2636
# uses global variable $project
2637
my ($revlist, $from, $to, $refs, $extra) = @_;
2638
2639
+ my $have_snapshot = gitweb_have_snapshot();
2640
+
2641
$from = 0 unless defined $from;
2642
$to = $#{$revlist} if (!defined $to || $#{$revlist} < $to);
2643
@@ -2663,7 +2665,7 @@ sub git_shortlog_body {
2665
$cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " .
2666
$cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " .
2667
$cgi->a({-href => href(action=>"tree", hash=>$commit, hash_base=>$commit)}, "tree");
2666
- if (gitweb_have_snapshot()) {
2668
+ if ($have_snapshot) {
2669
print " | " . $cgi->a({-href => href(action=>"snapshot", hash=>$commit)}, "snapshot");
2670
}
2671
print "</td>\n" .