From: Dave Rolsky Date: Sat, 25 Sep 2010 19:52:31 +0000 (-0500) Subject: Use _writer_core X-Git-Tag: 1.15~90 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d352fb4c37cdb0d0235ac11b662dc17f74be1802;p=gitmo%2FMoose.git Use _writer_core Get _potential_value from set --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm index 5c53f29..3580dcb 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm @@ -44,32 +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::Hash::set::_inline_check_arguments; - - my $potential_value = $self->_potential_value($slot_access); - - $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}"; @@ -84,12 +60,6 @@ sub _maximum_arguments {2} sub _adds_members {1} -sub _potential_value { - my ( $self, $slot_access ) = @_; - - return "%{ $slot_access, @_ }"; -} - sub _new_members {'$_[1]'} 1;