From: gfx Date: Sun, 12 Sep 2010 05:41:45 +0000 (+0900) Subject: Tweaks X-Git-Tag: 0.69~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7712ea964704e0f29fbdfeb1afb99dfff014d1e8;p=gitmo%2FMouse.git Tweaks --- diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index f4d3c64..e669f40 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -370,8 +370,7 @@ sub _parse_type { sub find_type_constraint { my($spec) = @_; - return $spec if Mouse::Util::is_a_type_constraint($spec); - return undef if !defined $spec; + return $spec if Mouse::Util::is_a_type_constraint($spec) or not defined $spec; $spec =~ s/\s+//g; return $TYPE{$spec}; @@ -389,8 +388,7 @@ sub register_type_constraint { sub find_or_parse_type_constraint { my($spec) = @_; - return $spec if Mouse::Util::is_a_type_constraint($spec); - return undef if !defined $spec; + return $spec if Mouse::Util::is_a_type_constraint($spec) or not defined $spec; $spec =~ s/\s+//g; return $TYPE{$spec} || do{