From c2875d9adf1cbb0e14b47e76c1c4bdd85dc3f980 Mon Sep 17 00:00:00 2001 From: Philipp Gortan Date: Fri, 24 Nov 2017 15:07:59 +0100 Subject: [PATCH] all code after "return 1" looks bogus as it will return undef anyhow --- lib/Moose/Meta/TypeConstraint.pm | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm index 3239b5145..834c56f25 100644 --- a/lib/Moose/Meta/TypeConstraint.pm +++ b/lib/Moose/Meta/TypeConstraint.pm @@ -232,19 +232,7 @@ sub equals { my ( $self, $type_or_name ) = @_; my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name); - return if not $other; - - return 1 if $self == $other; - - return unless $self->constraint == $other->constraint; - - if ( $self->has_parent ) { - return unless $other->has_parent; - return unless $self->parent->equals( $other->parent ); - } else { - return if $other->has_parent; - } - + return 1 if ($other && $self == $other); return; }