From: Dave Rolsky Date: Thu, 16 Jun 2011 15:29:22 +0000 (-0500) Subject: Optimize the get branch for hash accessors a little bit X-Git-Tag: 2.0102~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=178c5d84baf13c3a717c4aa2e6c39cba71819d23;p=gitmo%2FMoose.git Optimize the get branch for hash accessors a little bit --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm index 0a87a73..695f893 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm @@ -46,9 +46,9 @@ sub _generate_method { # the one from ::set and munge it to work for the ::get case # this should be fixed in a better way # -doy - 'my @keys_idx = 0..$#_;', + 'my @keys_idx = 0;', $self->_inline_check_var_is_valid_key('$_[0]'), - $self->Moose::Meta::Method::Accessor::Native::Hash::get::_inline_return_value($slot_access), + $slot_access . '->{$_[0]}', '}', # set 'else {',