Skip to content

Commit

Permalink
Fix regression in sequence operator
Browse files Browse the repository at this point in the history
Fixes #3570.  Apparently, .take flattens and take($_) does not.
Basically reverts 9286def .
  • Loading branch information
lizmat committed Mar 26, 2020
1 parent d8366ff commit 0a6456a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core.c/Rakudo/SEQUENCE.pm6
Expand Up @@ -126,7 +126,7 @@ class Rakudo::SEQUENCE {
for flat @a Z @e -> $from, $to {
@ranges.push: $($from ... $to);
}
my $ = take $_ for flat [X~] @ranges; # don't sink return of take()
my $ = .take for flat [X~] @ranges; # don't sink return of take()
$stop = 1;
}
elsif $a lt $endpoint {
Expand Down Expand Up @@ -319,7 +319,7 @@ class Rakudo::SEQUENCE {

if $stop { }
elsif &producer {
my $ = take $_ for @tail; # don't sink return of take()
my $ = .take for @tail; # don't sink return of take()
my $count := &producer.count;

until $stop {
Expand All @@ -335,20 +335,20 @@ class Rakudo::SEQUENCE {
) unless $end_code_arity == -Inf;

if $endpoint(|@end_tail) {
my $ = take value unless $exclude_end; # don't sink return of take()
my $ = value.take unless $exclude_end; # don't sink return of take()
$stop = 1;
}
}
}
elsif $endpoint.ACCEPTS(value) {
my $ = take value unless $exclude_end; # don't sink return of take()
my $ = value.take unless $exclude_end; # don't sink return of take()
$stop = 1;
}

if $stop { }
else {
@tail.push(value);
my $ = take value; # don't sink return of take()
my $ = value.take; # don't sink return of take()
}
}
}
Expand Down

0 comments on commit 0a6456a

Please sign in to comment.