* The base implementation of `_.difference` that accepts a single array * of values to exclude. * * @private * @param {Array} array The array to process. * @param {Array} [values] The array of values to exclude. * @returns {Array} Returns a new array of filtered values.
(array, values)
| 36104 | * @returns {Array} Returns a new array of filtered values. |
| 36105 | */ |
| 36106 | function baseDifference(array, values) { |
| 36107 | var index = -1, |
| 36108 | indexOf = getIndexOf(), |
| 36109 | length = array ? array.length : 0, |
| 36110 | isLarge = length >= largeArraySize && indexOf === baseIndexOf, |
| 36111 | result = []; |
| 36112 | |
| 36113 | if (isLarge) { |
| 36114 | var cache = createCache(values); |
| 36115 | if (cache) { |
| 36116 | indexOf = cacheIndexOf; |
| 36117 | values = cache; |
| 36118 | } else { |
| 36119 | isLarge = false; |
| 36120 | } |
| 36121 | } |
| 36122 | while (++index < length) { |
| 36123 | var value = array[index]; |
| 36124 | if (indexOf(values, value) < 0) { |
| 36125 | result.push(value); |
| 36126 | } |
| 36127 | } |
| 36128 | if (isLarge) { |
| 36129 | releaseObject(values); |
| 36130 | } |
| 36131 | return result; |
| 36132 | } |
| 36133 | |
| 36134 | /** |
| 36135 | * The base implementation of `_.flatten` without support for callback |
no test coverage detected