From: Dave Rolsky Date: Wed, 27 Aug 2008 16:40:33 +0000 (+0000) Subject: Remove another level of indentation for even more short-circuiting of X-Git-Tag: 0.55_04~2^2~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b15c3ddb211439d74d6c91d93ab0e7dc5419c486;p=gitmo%2FMoose.git Remove another level of indentation for even more short-circuiting of our loop. --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index f0a72c2..0c218e4 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -315,20 +315,20 @@ sub _fix_metaclass_incompatability { # fixes are needed $self->instance_metaclass->isa( $meta->instance_metaclass ); - if ( $meta->isa( ref($self) ) ) { - unless ( $self->is_pristine ) { - confess "Not reinitializing metaclass for " - . $self->name - . ", it isn't pristine"; - } + next unless $meta->isa( ref($self) ); - $self = $meta->reinitialize( - $self->name, - attribute_metaclass => $meta->attribute_metaclass, - method_metaclass => $meta->method_metaclass, - instance_metaclass => $meta->instance_metaclass, - ); + unless ( $self->is_pristine ) { + confess "Not reinitializing metaclass for " + . $self->name + . ", it isn't pristine"; } + + $self = $meta->reinitialize( + $self->name, + attribute_metaclass => $meta->attribute_metaclass, + method_metaclass => $meta->method_metaclass, + instance_metaclass => $meta->instance_metaclass, + ); } return $self;