Skip to content

Commit

Permalink
Fix scoping issue with Supply.skip, spotted by jnthn++
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jan 22, 2017
1 parent 4e49ec1 commit 15753fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Supply.pm
Expand Up @@ -1035,9 +1035,9 @@ my class Supply {
}

method skip(Supply:D: Int(Cool) $number = 1) {
my int $size = $number + 1;
my int $skipping = $size > 1;
supply {
my int $size = $number + 1;
my int $skipping = $size > 1;
whenever self {
.emit unless $skipping && ($skipping = --$size)
}
Expand Down

0 comments on commit 15753fd

Please sign in to comment.