Skip to content

Commit fa206af

Browse files
authored
Merge pull request #1454 from iamdoron/master
Use shift instead of splice (when possible) in queue
2 parents 3c69b36 + 6b63c2e commit fa206af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/queue.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export default function queue(worker, concurrency, payload) {
6565
var task = tasks[i];
6666

6767
var index = indexOf(workersList, task, 0);
68-
if (index >= 0) {
68+
if (index === 0) {
69+
workersList.shift();
70+
} else if (index > 0) {
6971
workersList.splice(index, 1);
7072
}
7173

0 commit comments

Comments
 (0)