Consistently use callback as the variable to store getCallback() results.

This commit is contained in:
jdalton
2015-05-04 09:06:06 -07:00
parent d825937411
commit 95b1455b62

View File

@@ -3432,12 +3432,12 @@
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
var func = getCallback(),
var callback = getCallback(),
noIteratee = iteratee == null;
if (!(func === baseCallback && noIteratee)) {
if (!(noIteratee && callback === baseCallback)) {
noIteratee = false;
iteratee = func(iteratee, thisArg, 3);
iteratee = callback(iteratee, thisArg, 3);
}
if (noIteratee) {
var isArr = isArray(collection);
@@ -3828,10 +3828,10 @@
*/
function createSortedIndex(retHighest) {
return function(array, value, iteratee, thisArg) {
var func = getCallback(iteratee);
return (func === baseCallback && iteratee == null)
var callback = getCallback(iteratee);
return (iteratee == null && callback === baseCallback)
? binaryIndex(array, value, retHighest)
: binaryIndexBy(array, value, func(iteratee, thisArg, 1), retHighest);
: binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
};
}
@@ -5890,9 +5890,9 @@
iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;
isSorted = false;
}
var func = getCallback();
if (!(func === baseCallback && iteratee == null)) {
iteratee = func(iteratee, thisArg, 3);
var callback = getCallback();
if (!(iteratee == null && callback === baseCallback)) {
iteratee = callback(iteratee, thisArg, 3);
}
return (isSorted && getIndexOf() == baseIndexOf)
? sortedUniq(array, iteratee)
@@ -11909,12 +11909,12 @@
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
var func = getCallback(),
var callback = getCallback(),
noIteratee = iteratee == null;
if (!(func === baseCallback && noIteratee)) {
if (!(noIteratee && callback === baseCallback)) {
noIteratee = false;
iteratee = func(iteratee, thisArg, 3);
iteratee = callback(iteratee, thisArg, 3);
}
return noIteratee
? arraySum(isArray(collection) ? collection : toIterable(collection))