Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
oops, don't use .elems to test for non-empty
(especially on lists that might not know their infinite)
  • Loading branch information
TimToady committed Apr 13, 2015
1 parent af9a7ca commit 49f168e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/operators.pm
Expand Up @@ -86,7 +86,7 @@ multi sub infix:<but>(Mu:U \obj, @roles) {
sub SEQUENCE(\left, Mu \right, :$exclude_end) {
my @right := nqp::iscont(right) ?? [right] !! (right,).list.flat;
die X::Cannot::Empty.new(:action('get sequence endpoint'), :what('list (use * or :!elems instead?)'))
unless @right.elems;
unless @right;
my $endpoint = @right.shift;
$endpoint.sink if $endpoint ~~ Failure;
my $infinite = nqp::istype($endpoint,Whatever) || $endpoint === Inf;
Expand Down Expand Up @@ -143,7 +143,7 @@ sub SEQUENCE(\left, Mu \right, :$exclude_end) {
(GATHER({
my @left := nqp::iscont(left) ?? [left] !! (left,).list.flat;
die X::Cannot::Empty.new(:action('get sequence start value'), :what('list'))
unless @left.elems;
unless @left;
my $value;
my $code;
my $stop;
Expand Down

0 comments on commit 49f168e

Please sign in to comment.