(4.17) Short circuit sortedIndexBy methods for empty arrays (#4497)

This commit is contained in:
Graeme Yeates
2019-10-04 13:23:55 -04:00
committed by John-David Dalton
parent b281ddecc4
commit 602cc3f03d
2 changed files with 17 additions and 4 deletions

View File

@@ -4129,11 +4129,14 @@
* into `array`.
*/
function baseSortedIndexBy(array, value, iteratee, retHighest) {
value = iteratee(value);
var low = 0,
high = array == null ? 0 : array.length,
valIsNaN = value !== value,
high = array == null ? 0 : array.length;
if (high === 0) {
return 0;
}
value = iteratee(value);
var valIsNaN = value !== value,
valIsNull = value === null,
valIsSymbol = isSymbol(value),
valIsUndefined = value === undefined;