From: Dave Rolsky Date: Sat, 25 Sep 2010 19:52:07 +0000 (-0500) Subject: Just use _writer_core for accessor X-Git-Tag: 1.15~91 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9fa449cd4a3fdd9e62d0b06e1df9c3e72b6bebe5;p=gitmo%2FMoose.git Just use _writer_core for accessor Get _potential_value from set class --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm index a419410..2c3f168 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm @@ -44,33 +44,8 @@ sub _generate_method { # set $code .= "\n" . '} else {'; - $code .= "\n" . $self->_inline_check_argument_count; - $code .= "\n" . $self->_inline_process_arguments( $inv, $slot_access ); - $code - .= "\n" - . $self - ->Moose::Meta::Method::Accessor::Native::Array::set::_inline_check_arguments; - - my $potential_value = $self->_potential_value($slot_access); - - $code .= "\n" . $self->_inline_copy_value( \$potential_value ); - $code .= "\n" - . $self->_inline_tc_code( - $potential_value, - $slot_access, - ); + $code .= "\n" . $self->_writer_core( $inv, $slot_access ); - $code .= "\n" . $self->_inline_get_old_value_for_trigger($inv); - $code .= "\n" . $self->_inline_capture_return_value($slot_access); - - $code .= "\n" - . $self->_inline_set_new_value( - $inv, - $potential_value, - $slot_access, - ); - - $code .= "\n" . $self->_inline_trigger( $inv, $slot_access, '@old' ); $code .= "\n" . $self->_inline_post_body(@_); $code .= "\n}"; @@ -85,13 +60,6 @@ sub _maximum_arguments {2} sub _adds_members {1} -sub _potential_value { - my ( $self, $slot_access ) = @_; - - return - "( do { my \@potential = \@{ $slot_access }; \$potential[ \$_[0] ] = \$_[1]; \@potential } )"; -} - sub _new_members {'$_[1]'} 1;