Re: [PATCHv5 03/17] gitweb/lib - Very simple file based cache

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

 



On 6 October 2010 23:44, Ãvar ArnfjÃrà Bjarmason <avarab@xxxxxxxxx> wrote:
> On Wed, Oct 6, 2010 at 22:41, Thomas Adam <thomas@xxxxxxxxxx> wrote:
>> On 6 October 2010 23:01, Jakub Narebski <jnareb@xxxxxxxxx> wrote:
>>> +# creates get_depth() and set_depth($depth) etc. methods
>>> +foreach my $i (qw(depth root namespace)) {
>>> + Â Â Â my $field = $i;
>>> + Â Â Â no strict 'refs';
>>
>> For each item, you'll set "no strict refs"? ÂThis might be better off
>> outside the loop. ÂIt's still scoped appropriately inside the
>> subroutine.
>>
>>> + Â Â Â my $file = $self->path_to_key($key);
>>> + Â Â Â return undef unless (defined $file && -f $file);
>>
>> PBP (Perl Best Practises) will tell you that explicitly returning
>> undef is discouraged -- "undef" should be reserved for those errors
>> you cannot handle, not ones you don't want to.
>
> [...]
>
>>> + Â Â Â return unless (defined $key && defined $data);
>>
>> return what?
>
> false. You're right that "return undef;" is bad style, but "return;"
> is what you should use instead.

I didn't mean that.  :)  It was a question to ensure this is what was
wanted, and not another undef.  I am well aware of the differences.

-- Thomas Adam
--
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]