Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Optimize array access a little.
  • Loading branch information
jnthn committed Oct 1, 2011
1 parent 27090e7 commit 698e301
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Array.pm
Expand Up @@ -10,9 +10,9 @@ class Array {
method at_pos($pos is copy) is rw {
$pos = $pos.Int;
self.exists($pos)
?? pir::find_method__PPs(List, 'at_pos')(self, $pos)
?? nqp::atpos(nqp::getattr(self, List, '$!items'), nqp::unbox_i($pos))
!! pir::setattribute__0PPsP(my $v, Scalar, '$!whence',
-> { pir::find_method__PPs(List, 'STORE_AT_POS')(self, $pos, $v) } )
-> { nqp::bindpos(nqp::getattr(self, List, '$!items'), nqp::unbox_i($pos), $v) } )
}

method flattens() { 1 }
Expand Down

0 comments on commit 698e301

Please sign in to comment.