Skip to content

Commit

Permalink
Merge pull request #826 from megawac/last-slice
Browse files Browse the repository at this point in the history
Use lookup instead of slice
  • Loading branch information
aearly committed Jul 2, 2015
2 parents 859710a + 74c23b0 commit fd7a99c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit fd7a99c

Please sign in to comment.