From: Tokuhiro Matsuno Date: Thu, 4 Dec 2008 08:28:28 +0000 (+0000) Subject: micro optimization X-Git-Tag: 0.19~136^2~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45f2e6a79a018ba03e0103272ab2830ee2efa783;p=gitmo%2FMouse.git micro optimization --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 0f04759..1b21446 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -5,7 +5,7 @@ use warnings; require overload; use Carp 'confess'; -use Mouse::Util qw/blessed weaken/; +require Mouse::Util; sub new { my $class = shift; @@ -100,7 +100,7 @@ sub generate_accessor { $accessor .= $self.'->{'.$key.'} = '.$value.';' . "\n"; if ($is_weak) { - $accessor .= 'weaken('.$self.'->{'.$key.'}) if ref('.$self.'->{'.$key.'});' . "\n"; + $accessor .= 'Mouse::Util::weaken('.$self.'->{'.$key.'}) if ref('.$self.'->{'.$key.'});' . "\n"; } if ($trigger) { @@ -304,7 +304,7 @@ sub find_type_constraint { my $checker = Mouse::TypeRegistry->optimized_constraints($self->associated_class->name)->{$type}; return $checker if $checker; - return sub { blessed($_) && blessed($_) eq $type }; + return sub { Mouse::Util::blessed($_) && Mouse::Util::blessed($_) eq $type }; } sub verify_type_constraint {