diff options
author | Alexander Early <alexander.early@gmail.com> | 2015-07-01 22:38:58 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2015-07-01 22:38:58 -0700 |
commit | fd7a99c09ceca52e629f70d0ca4cd7a387fb07c1 (patch) | |
tree | dd379e25f372f8d25758241bef05652368ea3526 /lib | |
parent | 859710a35175a3afffc4b0309756068de1bc88d8 (diff) | |
parent | 74c23b051149285384ade49006b9c6de49d55869 (diff) | |
download | async-fd7a99c09ceca52e629f70d0ca4cd7a387fb07c1.tar.gz |
Merge pull request #826 from megawac/last-slice
Use lookup instead of slice
Diffstat (limited to 'lib')
-rw-r--r-- | lib/async.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/async.js b/lib/async.js index a4dcce3..67eb379 100644 --- a/lib/async.js +++ b/lib/async.js @@ -561,7 +561,7 @@ async.setImmediate(taskComplete); } }); - var requires = task.slice(0, Math.abs(task.length - 1)) || []; + var requires = task.slice(0, Math.abs(task.length - 1)); // prevent dead-locks var len = requires.length; var dep; @@ -1134,7 +1134,7 @@ return _restParam(function (args) { var that = this; - var callback = args.slice(-1)[0]; + var callback = args[args.length - 1]; if (typeof callback == 'function') { args.pop(); } else { |