mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +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)) {
|
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
|
||||||
iteratee = null;
|
iteratee = null;
|
||||||
}
|
}
|
||||||
var func = getCallback(),
|
var callback = getCallback(),
|
||||||
noIteratee = iteratee == null;
|
noIteratee = iteratee == null;
|
||||||
|
|
||||||
if (!(func === baseCallback && noIteratee)) {
|
if (!(noIteratee && callback === baseCallback)) {
|
||||||
noIteratee = false;
|
noIteratee = false;
|
||||||
iteratee = func(iteratee, thisArg, 3);
|
iteratee = callback(iteratee, thisArg, 3);
|
||||||
}
|
}
|
||||||
if (noIteratee) {
|
if (noIteratee) {
|
||||||
var isArr = isArray(collection);
|
var isArr = isArray(collection);
|
||||||
@@ -3828,10 +3828,10 @@
|
|||||||
*/
|
*/
|
||||||
function createSortedIndex(retHighest) {
|
function createSortedIndex(retHighest) {
|
||||||
return function(array, value, iteratee, thisArg) {
|
return function(array, value, iteratee, thisArg) {
|
||||||
var func = getCallback(iteratee);
|
var callback = getCallback(iteratee);
|
||||||
return (func === baseCallback && iteratee == null)
|
return (iteratee == null && callback === baseCallback)
|
||||||
? binaryIndex(array, value, retHighest)
|
? 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;
|
iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;
|
||||||
isSorted = false;
|
isSorted = false;
|
||||||
}
|
}
|
||||||
var func = getCallback();
|
var callback = getCallback();
|
||||||
if (!(func === baseCallback && iteratee == null)) {
|
if (!(iteratee == null && callback === baseCallback)) {
|
||||||
iteratee = func(iteratee, thisArg, 3);
|
iteratee = callback(iteratee, thisArg, 3);
|
||||||
}
|
}
|
||||||
return (isSorted && getIndexOf() == baseIndexOf)
|
return (isSorted && getIndexOf() == baseIndexOf)
|
||||||
? sortedUniq(array, iteratee)
|
? sortedUniq(array, iteratee)
|
||||||
@@ -11909,12 +11909,12 @@
|
|||||||
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
|
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
|
||||||
iteratee = null;
|
iteratee = null;
|
||||||
}
|
}
|
||||||
var func = getCallback(),
|
var callback = getCallback(),
|
||||||
noIteratee = iteratee == null;
|
noIteratee = iteratee == null;
|
||||||
|
|
||||||
if (!(func === baseCallback && noIteratee)) {
|
if (!(noIteratee && callback === baseCallback)) {
|
||||||
noIteratee = false;
|
noIteratee = false;
|
||||||
iteratee = func(iteratee, thisArg, 3);
|
iteratee = callback(iteratee, thisArg, 3);
|
||||||
}
|
}
|
||||||
return noIteratee
|
return noIteratee
|
||||||
? arraySum(isArray(collection) ? collection : toIterable(collection))
|
? arraySum(isArray(collection) ? collection : toIterable(collection))
|
||||||
|
|||||||
Reference in New Issue
Block a user