[PATCH 4/5] gitweb: Clean up code in git_search_* subroutines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



1. Replace sequence of

     $foo .= "bar";
     $foo .= "baz";

   with

     $foo .= "bar" .
             "baz";

2. Use href(-replay=>1, -page=>undef) for first page of a multip-page
   view.

3. Rewrap (rearrange) some lines to reduce their length. Some lines
   still have more than 80 characters, but lines are shorter now.

No functional changes.

Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx>
---
 gitweb/gitweb.perl |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c350c05..1c06476 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5559,16 +5559,13 @@ sub git_search_message {
 	my $paging_nav = '';
 	if ($page > 0) {
 		$paging_nav .=
-			$cgi->a({-href => href(action=>"search", hash=>$hash,
-			                       searchtext=>$searchtext,
-			                       searchtype=>$searchtype)},
-			        "first");
-		$paging_nav .= " &sdot; " .
+			$cgi->a({-href => href(-replay=>1, page=>undef)},
+			        "first") .
+			" &sdot; " .
 			$cgi->a({-href => href(-replay=>1, page=>$page-1),
 			         -accesskey => "p", -title => "Alt-p"}, "prev");
 	} else {
-		$paging_nav .= "first";
-		$paging_nav .= " &sdot; prev";
+		$paging_nav .= "first &sdot; prev";
 	}
 	my $next_link = '';
 	if ($#commitlist >= 100) {
@@ -5613,10 +5610,13 @@ sub git_search_changes {
 			if (%co) {
 				print "</td>\n" .
 				      "<td class=\"link\">" .
-				      $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") .
+				      $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})},
+				              "commit") .
 				      " | " .
-				      $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
-				print "</td>\n" .
+				      $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'},
+				                             hash_base=>$co{'id'})},
+				              "tree") .
+				      "</td>\n" .
 				      "</tr>\n";
 			}
 
@@ -5650,10 +5650,13 @@ sub git_search_changes {
 	if (%co) {
 		print "</td>\n" .
 		      "<td class=\"link\">" .
-		      $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") .
+		      $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})},
+		              "commit") .
 		      " | " .
-		      $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree");
-		print "</td>\n" .
+		      $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'},
+		                             hash_base=>$co{'id'})},
+		              "tree") .
+		      "</td>\n" .
 		      "</tr>\n";
 	}
 
-- 
1.7.5

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]