Skip to content

Commit

Permalink
Mark reification target .push / .append as --> Nil
Browse files Browse the repository at this point in the history
Hopefully that will mean they optimize better in the future
  • Loading branch information
lizmat committed Apr 8, 2018
1 parent a53811c commit d9869e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/Array.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ my class Array { # declared in BOOTSTRAP
)
}

method push(Mu \value) {
method push(Mu \value --> Nil) {
nqp::push($!target,
nqp::assign(nqp::p6scalarfromdesc($!descriptor), value));
}

method append(IterationBuffer:D $buffer) {
method append(IterationBuffer:D $buffer --> Nil) {
nqp::if(
(my int $elems = nqp::elems($buffer)),
nqp::stmts(
Expand All @@ -57,12 +57,12 @@ my class Array { # declared in BOOTSTRAP
nqp::p6bindattrinvres(nqp::create(self), self, '$!target', target);
}

method push(Mu \value) {
method push(Mu \value --> Nil) {
nqp::push($!target,
nqp::decont(value));
}

method append(IterationBuffer:D \buffer) {
method append(IterationBuffer:D \buffer --> Nil) {
nqp::splice($!target,buffer,nqp::elems($!target),0)
}
}
Expand Down

0 comments on commit d9869e5

Please sign in to comment.