git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] gitweb: optimize git_shortlog_body.

From
RFRobert Fitzsimons <robfitz@273k.net>
Date
Dec 22, 2006, 19:38 UTC
Message-ID
<11668162963240-git-send-email-robfitz@273k.net>
In-Reply-To
<11668162963671-git-send-email-robfitz@273k.net>
Don't call gitweb_have_snapshot from within the loop.
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
---
 gitweb/gitweb.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 01e3a8a..d2ddac8 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 "</td>\n" .
-- 
1.4.4.3.gc902c
Previous: Robert FitzsimonsNext: Robert Fitzsimons
Message 4 of 8 in “gitweb: Add missing show '...' links change.”
  1. 1/4 gitweb: Add missing show '...' links change.Robert Fitzsimons, Dec 22, 2006
  2. 1/4 gitweb: Add missing show '...' links change.Robert Fitzsimons, Dec 22, 2006
  3. 2/4 gitweb: optimize git_get_last_activity.Robert Fitzsimons, Dec 22, 2006
  4. 3/4 gitweb: optimize git_shortlog_body.Robert Fitzsimons, Dec 22, 2006
  5. 4/4 gitweb: optimize git_summary.Robert Fitzsimons, Dec 22, 2006
  6. Jakub NarebskiDec 22, 2006
  7. Jakub NarebskiDec 22, 2006
  8. Junio C HamanoDec 22, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.