Skip to content

Commit

Permalink
Update style
Browse files Browse the repository at this point in the history
  • Loading branch information
timursevimli committed Jan 8, 2024
1 parent 98f479c commit ed968aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ class Queue {
else this.waiting.unshift(task);

if (this.priorityMode) {
if (this.fifoMode) this.waiting.sort((a, b) => b.priority - a.priority);
else this.waiting.sort((a, b) => a.priority - b.priority);
const compare = this.fifoMode ? (a, b) => b - a : (a, b) => a - b;
this.waiting.sort(({ priority: a }, { priority: b }) => compare(a, b));
}
}

Expand Down

0 comments on commit ed968aa

Please sign in to comment.