MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / baseDifference

Function baseDifference

MathBox/mathbox-bundle.js:36106–36132  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 4

omitFunction · 0.85
differenceFunction · 0.85
withoutFunction · 0.85
xorFunction · 0.85

Calls 4

getIndexOfFunction · 0.85
releaseObjectFunction · 0.85
createCacheFunction · 0.70
indexOfFunction · 0.70

Tested by

no test coverage detected