mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 20:07:49 +00:00
Remove value guards in baseDifference and baseSortedUniqBy.
This commit is contained in:
11
lodash.js
11
lodash.js
@@ -1939,7 +1939,7 @@
|
|||||||
* @returns {Array} Returns the new array of filtered values.
|
* @returns {Array} Returns the new array of filtered values.
|
||||||
*/
|
*/
|
||||||
function baseDifference(array, values) {
|
function baseDifference(array, values) {
|
||||||
var length = array ? array.length : 0,
|
var length = array.length,
|
||||||
result = [];
|
result = [];
|
||||||
|
|
||||||
if (!length) {
|
if (!length) {
|
||||||
@@ -2848,13 +2848,10 @@
|
|||||||
* @returns {Array} Returns the new duplicate free array.
|
* @returns {Array} Returns the new duplicate free array.
|
||||||
*/
|
*/
|
||||||
function baseSortedUniqBy(array, iteratee) {
|
function baseSortedUniqBy(array, iteratee) {
|
||||||
var length = array.length;
|
|
||||||
if (!length) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
var index = 0,
|
var index = 0,
|
||||||
indexOf = getIndexOf(),
|
indexOf = getIndexOf(),
|
||||||
isCommon = indexOf === baseIndexOf,
|
isCommon = indexOf === baseIndexOf,
|
||||||
|
length = array.length,
|
||||||
value = array[0],
|
value = array[0],
|
||||||
computed = iteratee ? iteratee(value) : value,
|
computed = iteratee ? iteratee(value) : value,
|
||||||
seen = isCommon ? computed : [computed],
|
seen = isCommon ? computed : [computed],
|
||||||
@@ -5743,7 +5740,9 @@
|
|||||||
: array;
|
: array;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result ? baseUniq(result) : [];
|
return (result && result.length)
|
||||||
|
? baseUniq(result)
|
||||||
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user