From: Dave Rolsky Date: Thu, 23 Oct 2008 16:18:28 +0000 (+0000) Subject: Tidy some code here. Also remove an unused variable. X-Git-Tag: 0.60~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=622c933291338c172c08ec57dbf2b2b7c87a7802;p=gitmo%2FMoose.git Tidy some code here. Also remove an unused variable. --- diff --git a/lib/Moose/Meta/TypeConstraint/Union.pm b/lib/Moose/Meta/TypeConstraint/Union.pm index a96a576..e047b6f 100644 --- a/lib/Moose/Meta/TypeConstraint/Union.pm +++ b/lib/Moose/Meta/TypeConstraint/Union.pm @@ -101,24 +101,25 @@ sub is_subtype_of { } sub create_child_type { - my ($self, %opts) = @_; - my $class = ref $self; - my $constraint = Moose::Meta::TypeConstraint->new(%opts, parent => $self); - + my ( $self, %opts ) = @_; + + my $constraint + = Moose::Meta::TypeConstraint->new( %opts, parent => $self ); + # if we have a type constraint union, and no # type check, this means we are just aliasing # the union constraint, which means we need to # handle this differently. # - SL - if ( - not(defined $opts{constraint}) - && $self->has_coercion - ) { - $constraint->coercion(Moose::Meta::TypeCoercion::Union->new( - type_constraint => $self, - )); + if ( not( defined $opts{constraint} ) + && $self->has_coercion ) { + $constraint->coercion( + Moose::Meta::TypeCoercion::Union->new( + type_constraint => $self, + ) + ); } - + return $constraint; }