Skip to content

Commit

Permalink
Make it simpler and faster, mst++
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 25, 2015
1 parent c938b10 commit c017f78
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/asyncops.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ sub awaiterator(@awaitables) {
elsif @!todo {
Promise.anyof(@!todo).result;
my @next;
while @!todo {
my $promise = @!todo.shift;
$promise.status == Planned
?? @next.push($promise)
!! @!done.push($promise.result);
}
.status == Planned
?? @next.push($_)
!! @!done.push($_.result)
for @!todo;
@!todo := @next;
@!done.shift
}
Expand Down

0 comments on commit c017f78

Please sign in to comment.