Skip to content

Commit

Permalink
fix: use shift instead of pop for enqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Mar 31, 2024
1 parent 7e757cf commit d33412e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/handlers/enqueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const handler = (({ max = 1 }: { max?: number } = { max: 1 }) => {
/** empty */
}
running--;
const next = queue.pop();
const next = queue.shift();
if (next) {
handle(next.fn, next.utils);
}
Expand Down

0 comments on commit d33412e

Please sign in to comment.