Re: [PATCH] gitweb: make feature_blame return a list

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

 



On Mon, Dec 15, 2008 at 02:20:03PM -0800, Junio C Hamano wrote:
> Matt Kraai <kraai@xxxxxxxxx> writes:
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -367,12 +367,12 @@ sub feature_blame {
> >  	my ($val) = git_get_project_config('blame', '--bool');
> >  
> >  	if ($val eq 'true') {
> > -		return 1;
> > +		return (1);
> >  	} elsif ($val eq 'false') {
> > -		return 0;
> > +		return (0);
> >  	}
> >  
> > -	return $_[0];
> > +	return ($_[0]);
> >  }
> 
> My Perl may be getting rusty, but does the above make any difference?

I'm still relatively new to Perl, but at least in my limited testing,
I couldn't generate a case in which these different constructs had
different results.

I made this change so that all of the boolean feature subroutines
would have the same body, modulo the name of the option; that way,
replacing them with a single routine only involves making the option
name a parameter.

If you'd like me to resubmit my second patch, I'm happy to do so.
Just let me know whether you prefer the resulting function to wrap its
return values in parentheses (as is currently done by feature_grep and
feature_pickaxe) or not.

-- 
Matt                                                 http://ftbfs.org/
--
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]

  Powered by Linux