mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Cleanup baseDifference.
This commit is contained in:
@@ -1837,15 +1837,16 @@
|
|||||||
* @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 ? array.length : 0,
|
||||||
|
result = [];
|
||||||
|
|
||||||
if (!length) {
|
if (!length) {
|
||||||
return [];
|
return result;
|
||||||
}
|
}
|
||||||
var index = -1,
|
var index = -1,
|
||||||
indexOf = getIndexOf(),
|
indexOf = getIndexOf(),
|
||||||
isCommon = indexOf == baseIndexOf,
|
isCommon = indexOf == baseIndexOf,
|
||||||
cache = isCommon && values.length >= 200 && createCache(values),
|
cache = isCommon && values.length >= 200 && createCache(values),
|
||||||
result = [],
|
|
||||||
valuesLength = values.length;
|
valuesLength = values.length;
|
||||||
|
|
||||||
if (cache) {
|
if (cache) {
|
||||||
|
|||||||
Reference in New Issue
Block a user