Skip to content
Permalink
Browse files

Use a cheaper assignment in array assign slow path

It's a slow path, but we don't have to make it slower than it needs to
be!
  • Loading branch information...
jnthn committed Apr 8, 2019
1 parent 29ce2ce commit 847783e26c69f2cbdf24a08f6041157e105af33a
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/Array.pm6
@@ -547,7 +547,7 @@ my class Array { # declared in BOOTSTRAP
nqp::if(
nqp::islt_i($pos,0),
self!INDEX_OOR($pos),
nqp::if(
nqp::p6assign(nqp::if(
nqp::isconcrete(nqp::getattr(self,List,'$!reified')),
nqp::ifnull(
nqp::atpos(nqp::getattr(self,List,'$!reified'),$pos),
@@ -591,7 +591,7 @@ my class Array { # declared in BOOTSTRAP
$pos,
nqp::p6bindattrinvres(nqp::create(Scalar), Scalar, '$!descriptor', $!descriptor)
)
) = assignee
), assignee)
)
}

1 comment on commit 847783e

@lizmat

This comment has been minimized.

Copy link
Contributor

commented on 847783e Apr 9, 2019

There are about 10 similar situations in the core setting. Should those be changed as well?

Please sign in to comment.
You can’t perform that action at this time.