Skip to content

Commit

Permalink
Merge pull request #1454 from iamdoron/master
Browse files Browse the repository at this point in the history
Use shift instead of splice (when possible) in queue
  • Loading branch information
megawac committed Jul 24, 2017
2 parents 3c69b36 + 6b63c2e commit fa206af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/queue.js
Expand Up @@ -65,7 +65,9 @@ export default function queue(worker, concurrency, payload) {
var task = tasks[i];

var index = indexOf(workersList, task, 0);
if (index >= 0) {
if (index === 0) {
workersList.shift();
} else if (index > 0) {
workersList.splice(index, 1);
}

Expand Down

0 comments on commit fa206af

Please sign in to comment.