Skip to content

Commit

Permalink
Merge pull request #786 from Horx/master
Browse files Browse the repository at this point in the history
covert some 2 space to 4
  • Loading branch information
aearly committed Jun 11, 2015
2 parents e91ff72 + ea3bf36 commit eb54a2d
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

if (root != null) {
previous_async = root.async;
previous_async = root.async;
}

async.noConflict = function () {
Expand Down Expand Up @@ -74,23 +74,23 @@
}

function _arrayEach(arr, iterator) {
var index = -1,
length = arr.length;
var index = -1,
length = arr.length;

while (++index < length) {
iterator(arr[index], index, arr);
}
while (++index < length) {
iterator(arr[index], index, arr);
}
}

function _map(arr, iterator) {
var index = -1,
length = arr.length,
result = Array(length);

while (++index < length) {
result[index] = iterator(arr[index], index, arr);
}
return result;
var index = -1,
length = arr.length,
result = Array(length);

while (++index < length) {
result[index] = iterator(arr[index], index, arr);
}
return result;
}

function _range(count) {
Expand Down Expand Up @@ -146,13 +146,13 @@
var length = arr.length;

if (start) {
length -= start;
length = length < 0 ? 0 : length;
length -= start;
length = length < 0 ? 0 : length;
}
var result = Array(length);

while (++index < length) {
result[index] = arr[index + start];
result[index] = arr[index + start];
}
return result;
}
Expand Down Expand Up @@ -193,7 +193,7 @@
if (_setImmediate) {
async.setImmediate = function (fn) {
// not a direct alias for IE10 compatibility
_setImmediate(fn);
_setImmediate(fn);
};
}
else {
Expand Down Expand Up @@ -230,15 +230,15 @@
iterator(object[key], key, only_once(done));
});
function done(err) {
if (err) {
callback(err);
}
else {
completed += 1;
if (completed >= size) {
callback(null);
}
}
if (err) {
callback(err);
}
else {
completed += 1;
if (completed >= size) {
callback(null);
}
}
}
};

Expand Down Expand Up @@ -638,8 +638,8 @@
async.waterfall = function (tasks, callback) {
callback = _once(callback || noop);
if (!_isArray(tasks)) {
var err = new Error('First argument to waterfall must be an array of functions');
return callback(err);
var err = new Error('First argument to waterfall must be an array of functions');
return callback(err);
}
if (!tasks.length) {
return callback();
Expand Down Expand Up @@ -834,9 +834,9 @@
};

if (pos) {
q.tasks.unshift(item);
q.tasks.unshift(item);
} else {
q.tasks.push(item);
q.tasks.push(item);
}

if (q.tasks.length === q.concurrency) {
Expand Down Expand Up @@ -1062,9 +1062,9 @@
};

async.unmemoize = function (fn) {
return function () {
return (fn.unmemoized || fn).apply(null, arguments);
};
return function () {
return (fn.unmemoized || fn).apply(null, arguments);
};
};

function _times(mapper) {
Expand Down Expand Up @@ -1106,7 +1106,7 @@
};

async.compose = function (/* functions... */) {
return async.seq.apply(null, Array.prototype.reverse.call(arguments));
return async.seq.apply(null, Array.prototype.reverse.call(arguments));
};


Expand Down

0 comments on commit eb54a2d

Please sign in to comment.