Cleanup cachedContains.

Former-commit-id: a2b396e910eacc0e204d5bdb3f4ed834b8d6e148
This commit is contained in:
John-David Dalton
2012-11-02 22:50:45 -07:00
parent 9dc33c6086
commit a8ff5385dc
2 changed files with 6 additions and 6 deletions

View File

@@ -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;
}
}