diff --git a/lodash.js b/lodash.js index 72ea7462f..17a8dbfe1 100644 --- a/lodash.js +++ b/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; } } diff --git a/lodash.min.js b/lodash.min.js index 31e7e1c68..c30a9335c 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -2,7 +2,7 @@ Lo-Dash 0.9.1 lodash.com/license Underscore.js 1.4.2 underscorejs.org/LICENSE */ -;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||Q),s=i?{}:e;if(i)for(n=t-1;++nn||e===t)return 1;if(e=(n||Q);if(i)for(var s={},n=t-1;++nn||e===t)return 1;if(ei;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===j)&&"),r+="g.call(j,h)){w=j[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return r",Function("e,g,i,n,l,q,t,v","return function("+t+"){"+r+"}")(f,dt,v,$t,xt,mt,Pt,yt)}function c(e){return"\\"+Jt[e]}function h(e){return en