From: Brad Bowman Date: Wed, 28 Sep 2011 01:49:31 +0000 (+1000) Subject: inline_slot_access not inline_create_instance eg. X-Git-Tag: 2.0301~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2dbd5ebf42aff7da3355a9cde76f35bc87c4ef23;hp=251c65399c9432e8431e2752f063d1870c502bd8;p=gitmo%2FMoose.git inline_slot_access not inline_create_instance eg. The text refers to inline_slot_access, but the code shown is for inline_create_instance. This shows the inline_slot_access code instead, as presumably intended. --- diff --git a/lib/Moose/Cookbook/Meta/Recipe7.pod b/lib/Moose/Cookbook/Meta/Recipe7.pod index b3746e6..b661d44 100644 --- a/lib/Moose/Cookbook/Meta/Recipe7.pod +++ b/lib/Moose/Cookbook/Meta/Recipe7.pod @@ -150,9 +150,9 @@ This level of indirection probably makes our instance class I than the default. However, when attribute access is inlined, this lookup will be cached: - sub inline_create_instance { - my ( $self, $class_variable ) = @_; - return 'do { my $sym = Symbol::gensym(); bless $sym, ' . $class_variable . ' }'; + sub inline_slot_access { + my ( $self, $instance, $slot_name ) = @_; + return '*{' . $instance . '}->{' . $slot_name . '}'; } The code snippet that the C method returns will