mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Cleanup cachedContains.
Former-commit-id: a2b396e910eacc0e204d5bdb3f4ed834b8d6e148
This commit is contained in:
10
lodash.js
10
lodash.js
@@ -450,12 +450,12 @@
|
||||
fromIndex || (fromIndex = 0);
|
||||
|
||||
var length = array.length,
|
||||
isLarge = (length - fromIndex) >= (largeSize || largeArraySize),
|
||||
cache = isLarge ? {} : array;
|
||||
isLarge = (length - fromIndex) >= (largeSize || largeArraySize);
|
||||
|
||||
if (isLarge) {
|
||||
// init value cache
|
||||
var index = fromIndex - 1;
|
||||
var cache = {},
|
||||
index = fromIndex - 1;
|
||||
|
||||
while (++index < length) {
|
||||
// manually coerce `value` to string because `hasOwnProperty`, in some
|
||||
// older versions of Firefox, coerces objects incorrectly
|
||||
@@ -468,7 +468,7 @@
|
||||
var key = value + '';
|
||||
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
|
||||
}
|
||||
return indexOf(cache, value, fromIndex) > -1;
|
||||
return indexOf(array, value, fromIndex) > -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user