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
index 27f6b53..22a0d45 100644 (file)
@@ -14,7 +14,13 @@ sub _adds_members { 1 }
 sub _potential_value {
     my ( $self, $slot_access ) = @_;
 
-    return "( \@_, \@{ $slot_access } )";
+    return "[ \@_, \@{ $slot_access } ]";
+}
+
+sub _inline_optimized_set_new_value {
+    my ( $self, $inv, $new, $slot_access ) = @_;
+
+    return "unshift \@{ $slot_access }, \@_;";
 }
 
 1;