mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Consistently use callback as the variable to store getCallback() results.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user