summaryrefslogtreecommitdiff
path: root/lib/internal/queue.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2017-04-03 01:17:11 -0700
committerAlexander Early <alexander.early@gmail.com>2017-04-03 01:21:22 -0700
commit67e76ea150f30561e9ce7624459031197c45a68a (patch)
tree8a789dd8af5efbb133a75e3e04626f493fe1662b /lib/internal/queue.js
parent2ae34926f070cdeec38f4bcd0ad173fa6a963904 (diff)
downloadasync-67e76ea150f30561e9ce7624459031197c45a68a.tar.gz
remove rest completely
Diffstat (limited to 'lib/internal/queue.js')
-rw-r--r--lib/internal/queue.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/internal/queue.js b/lib/internal/queue.js
index 479eaf8..2eb523a 100644
--- a/lib/internal/queue.js
+++ b/lib/internal/queue.js
@@ -1,7 +1,6 @@
import indexOf from 'lodash/_baseIndexOf';
import isArray from 'lodash/isArray';
import noop from 'lodash/noop';
-import rest from './rest';
import onlyOnce from './onlyOnce';
import setImmediate from './setImmediate';
@@ -51,7 +50,7 @@ export default function queue(worker, concurrency, payload) {
}
function _next(tasks) {
- return rest(function(args){
+ return function(err){
numRunning -= 1;
for (var i = 0, l = tasks.length; i < l; i++) {
@@ -61,10 +60,10 @@ export default function queue(worker, concurrency, payload) {
workersList.splice(index)
}
- task.callback.apply(task, args);
+ task.callback.apply(task, arguments);
- if (args[0] != null) {
- q.error(args[0], task.data);
+ if (err != null) {
+ q.error(err, task.data);
}
}
@@ -76,7 +75,7 @@ export default function queue(worker, concurrency, payload) {
q.drain();
}
q.process();
- });
+ };
}
var isProcessing = false;