aboutsummaryrefslogtreecommitdiff
path: root/node_modules/async/race.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/async/race.js')
-rw-r--r--node_modules/async/race.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/node_modules/async/race.js b/node_modules/async/race.js
index 384ea1012..4d0625b9b 100644
--- a/node_modules/async/race.js
+++ b/node_modules/async/race.js
@@ -9,10 +9,6 @@ var _isArray = require('lodash/isArray');
var _isArray2 = _interopRequireDefault(_isArray);
-var _arrayEach = require('lodash/_arrayEach');
-
-var _arrayEach2 = _interopRequireDefault(_arrayEach);
-
var _noop = require('lodash/noop');
var _noop2 = _interopRequireDefault(_noop);
@@ -25,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
/**
* Runs the `tasks` array of functions in parallel, without waiting until the
- * previous function has completed. Once any the `tasks` completed or pass an
+ * previous function has completed. Once any of the `tasks` complete or pass an
* error to its callback, the main `callback` is immediately called. It's
* equivalent to `Promise.race()`.
*
@@ -64,8 +60,8 @@ function race(tasks, callback) {
callback = (0, _once2.default)(callback || _noop2.default);
if (!(0, _isArray2.default)(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));
if (!tasks.length) return callback();
- (0, _arrayEach2.default)(tasks, function (task) {
- task(callback);
- });
+ for (var i = 0, l = tasks.length; i < l; i++) {
+ tasks[i](callback);
+ }
}
module.exports = exports['default']; \ No newline at end of file