Skip to content

Commit 74fd872

Browse files
jnarebgitster
authored andcommitted
gitweb: Remove function prototypes (cleanup)
Use of function prototypes is considered bad practice in Perl. The ones used here didn't accomplish anything anyhow, so they've been removed. >From perlsub(1): [...] the intent of this feature [prototypes] is primarily to let you define subroutines that work like built-in functions [...] you can generate new syntax with it [...] We don't want to have subroutines behaving exactly like built-in functions, we don't want to define new syntax / syntactic sugar, so prototypes in gitweb are not needed... and they can have unintended consequences. Signed-off-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5a0e4a2 commit 74fd872

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gitweb/gitweb.perl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ sub evaluate_path_info {
838838
## ======================================================================
839839
## action links
840840

841-
sub href (%) {
841+
sub href {
842842
my %params = @_;
843843
# default is to use -absolute url() i.e. $my_uri
844844
my $href = $params{-full} ? $my_url : $my_uri;
@@ -1036,7 +1036,7 @@ sub esc_url {
10361036
}
10371037

10381038
# replace invalid utf8 character with SUBSTITUTION sequence
1039-
sub esc_html ($;%) {
1039+
sub esc_html {
10401040
my $str = shift;
10411041
my %opts = @_;
10421042

@@ -1296,7 +1296,7 @@ sub age_string {
12961296
};
12971297

12981298
# submodule/subproject, a commit object reference
1299-
sub S_ISGITLINK($) {
1299+
sub S_ISGITLINK {
13001300
my $mode = shift;
13011301

13021302
return (($mode & S_IFMT) == S_IFGITLINK)
@@ -2615,7 +2615,7 @@ sub parsed_difftree_line {
26152615
}
26162616

26172617
# parse line of git-ls-tree output
2618-
sub parse_ls_tree_line ($;%) {
2618+
sub parse_ls_tree_line {
26192619
my $line = shift;
26202620
my %opts = @_;
26212621
my %res;
@@ -3213,7 +3213,6 @@ sub git_print_header_div {
32133213
"\n</div>\n";
32143214
}
32153215

3216-
#sub git_print_authorship (\%) {
32173216
sub git_print_authorship {
32183217
my $co = shift;
32193218

@@ -3269,8 +3268,7 @@ sub git_print_page_path {
32693268
print "<br/></div>\n";
32703269
}
32713270

3272-
# sub git_print_log (\@;%) {
3273-
sub git_print_log ($;%) {
3271+
sub git_print_log {
32743272
my $log = shift;
32753273
my %opts = @_;
32763274

0 commit comments

Comments
 (0)