From: Dave Rolsky Date: Fri, 20 Mar 2009 16:43:51 +0000 (-0500) Subject: Remove unused bit of code X-Git-Tag: 0.72_01~63^2^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db72153d536dd5d0fcd609bcd06afd91d67d841c;p=gitmo%2FMoose.git Remove unused bit of code --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index a4d83ba..e487ca3 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -246,28 +246,23 @@ sub clone { my $class = $params{metaclass} || ref $self; - if ( 0 and $class eq ref $self ) { - return $self->SUPER::clone(%params); - } else { - my ( @init, @non_init ); + my ( @init, @non_init ); - foreach my $attr ( grep { $_->has_value($self) } $self->meta->compute_all_applicable_attributes ) { - push @{ $attr->has_init_arg ? \@init : \@non_init }, $attr; - } - - my %new_params = ( ( map { $_->init_arg => $_->get_value($self) } @init ), %params ); - - my $name = delete $new_params{name}; + foreach my $attr ( grep { $_->has_value($self) } $self->meta->compute_all_applicable_attributes ) { + push @{ $attr->has_init_arg ? \@init : \@non_init }, $attr; + } - my $clone = $class->new($name, %new_params, __hack_no_process_options => 1 ); + my %new_params = ( ( map { $_->init_arg => $_->get_value($self) } @init ), %params ); - foreach my $attr ( @non_init ) { - $attr->set_value($clone, $attr->get_value($self)); - } + my $name = delete $new_params{name}; + my $clone = $class->new($name, %new_params, __hack_no_process_options => 1 ); - return $clone; + foreach my $attr ( @non_init ) { + $attr->set_value($clone, $attr->get_value($self)); } + + return $clone; } sub _process_options {