Re: [PATCH] gitweb: merge boolean feature subroutines
- From
- demerphq <demerphq@gmail.com>
- Date
- Jan 3, 2009, 16:18 UTC
- Message-ID
- <9b18b3110901030818i242d81ccl20ef3f264ec64cad@mail.gmail.com>
- In-Reply-To
- <1230996692-7182-1-git-send-email-kraai@ftbfs.org>
2009/1/3 Matt Kraai <kraai@ftbfs.org>: [...]
Show 8 quoted lines
> -sub feature_blame {
> - my ($val) = git_get_project_config('blame', '--bool');
> +sub feature_bool {
> + my $key = shift;
> + my ($val) = git_get_project_config($key, '--bool');
>
> if ($val eq 'true') {
> return 1;Maybe that should be:
return ($val eq 'true');
as It is not a good idea to use 0 as a replacement for perls false, as the two have different behaviour.
$perl -wle'my $val=shift; my $x=$val eq "true"; print "<$_>" for $x, 0+$x' false <> <0>
Cheers, yves
-- perl -Mre=debug -e "/just|another|perl|hacker/"