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

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

 



On Wed, Oct 6, 2010 at 22:01, Jakub Narebski <jnareb@xxxxxxxxx> wrote:

> +sub new {
> + Â Â Â my ($proto, $p_options_hash_ref) = @_;
> +
> + Â Â Â my $class = ref($proto) || $proto;
> + Â Â Â my $self Â= {};
> + Â Â Â $self = bless($self, $class);

You use:

    my $class = ref($proto) || $proto;

Throughout the new class definitions. Presumably that's just
copy/pasted from some old docs and you don't actually want to support:

    my $obj = Class->new;
    my $obj2 = $obj->new;

It's better just to:

    sub new {
        my ($class, $options) = @_:
        my $self = bless {}, $class;

Unless there's some reason for the ref($proto) that I've missed.
--
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]