Skip to content

Commit

Permalink
Fix Supply.zip watermark changes
Browse files Browse the repository at this point in the history
We are only done when all supplies hit the watermark, not when the first
hits the mark.
  • Loading branch information
patrickbkr committed Feb 21, 2023
1 parent 6e2a46f commit 2225e20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core.c/Supply-coercers.pm6
Expand Up @@ -789,9 +789,9 @@
if &with {
whenever $supply -> \val {
@values[$index].push(val);
my $new-count = @counts[$index]++;
@counts[$index]++;
emit( [[&with]] @values.map(*.shift) ) if all(@values);
done if $new-count == $watermark;
done if all(@counts) >= $watermark;
LAST {
$watermark min= @counts[$index];
done if all(@counts) >= $watermark;
Expand All @@ -801,9 +801,9 @@
else {
whenever $supply -> \val {
@values[$index].push(val);
my $new-count = @counts[$index]++;
@counts[$index]++;
emit( $(@values.map(*.shift).list.eager) ) if all(@values);
done if $new-count == $watermark;
done if all(@counts) >= $watermark;
LAST {
$watermark min= @counts[$index];
done if all(@counts) >= $watermark;
Expand Down

0 comments on commit 2225e20

Please sign in to comment.