Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make xx about 1.8 times faster (for xx 1024)
  • Loading branch information
lizmat committed Apr 17, 2015
1 parent 420a9b5 commit 4e8a163
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/List.pm
Expand Up @@ -685,14 +685,16 @@ multi sub infix:<xx>(Mu \x, Whatever) {
GatherIter.new({ loop { take x } }, :infinite(True)).list
}
multi sub infix:<xx>(Mu \x, Int() $n) {
my int $size = $n + 1;
my int $size = $n;

my Mu $rpa := nqp::list();
if $size > 1 {
if $size > 0 {
nqp::setelems($rpa, $size);
nqp::setelems($rpa, 0);

nqp::push($rpa,x) while $size = $size - 1;
my int $i;
while $i < $size {
nqp::bindpos($rpa,$i,x);
$i = $i + 1;
}
}

nqp::p6parcel($rpa, Any);
Expand Down

0 comments on commit 4e8a163

Please sign in to comment.