X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=afe92940c085a385a7861c6cd2aecb6796889a8d;hp=f09cdaa8147e49c7d45e6dad89772e2e715e5f4e;hb=815f725aeff0bd44da8d75e7cd4ac456e9e60238;hpb=4859d490c20857ad700946803544f1d9e83a56bd diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index f09cdaa..afe9294 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -160,38 +160,10 @@ sub is_immutable { $_[0]->{is_immutable} } sub attribute_metaclass { "Mouse::Meta::Class" } -sub _install_fast_modifier { - my $self = shift; - my $into = shift; - my $type = shift; - my $modifier = pop; - - foreach my $name (@_) { - my $method = Data::Util::get_code_ref( $into, $name ); - - if ( !$method || !Data::Util::subroutine_modifier($method) ) { - - unless ($method) { - $method = $into->can($name) - or confess "The method '$name' is not found in the inheritance hierarchy for class $into"; - } - $method = Data::Util::modify_subroutine( $method, - $type => [$modifier] ); - - no warnings 'redefine'; - Data::Util::install_subroutine( $into, $name => $method ); - } - else { - Data::Util::subroutine_modifier( $method, $type => $modifier ); - } - } - return; -} - sub _install_modifier { my ( $self, $into, $type, $name, $code ) = @_; - if (eval "require Data::Util; 1") { - $self->_install_fast_modifier( + if (eval "require Class::Method::Modifiers::Fast; 1") { + Class::Method::Modifiers::Fast::_install_modifier( $into, $type, $name,