Refactored native trait inlining some more - added an optimized path to avoid copying...
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Array / unshift.pm
CommitLineData
a7821be5 1package Moose::Meta::Method::Accessor::Native::Array::unshift;
2
3use strict;
4use warnings;
5
6our $VERSION = '1.13';
7$VERSION = eval $VERSION;
8our $AUTHORITY = 'cpan:STEVAN';
9
10use base 'Moose::Meta::Method::Accessor::Native::Array::Writer';
11
12sub _adds_members { 1 }
13
14sub _potential_value {
15 my ( $self, $slot_access ) = @_;
16
e32b7489 17 return "[ \@_, \@{ $slot_access } ]";
18}
19
20sub _inline_optimized_set_new_value {
21 my ( $self, $inv, $new, $slot_access ) = @_;
22
23 return "unshift \@{ $slot_access }, \@_;";
a7821be5 24}
25
261;