From b5842314b49a712b2cc7207a8514ac21c3a80a3f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 7 Jun 2016 08:33:48 -0700 Subject: [PATCH] Make `LARGE_ARRAY_SIZE` check in `stackSet` align with others. --- lodash.js | 2 +- test/test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index c30b35516..636a32a0a 100644 --- a/lodash.js +++ b/lodash.js @@ -2167,7 +2167,7 @@ var cache = this.__data__; if (cache instanceof ListCache) { var pairs = cache.__data__; - if (!Map || pairs.length < LARGE_ARRAY_SIZE) { + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); return this; } diff --git a/test/test.js b/test/test.js index a817370a9..74735d6c5 100644 --- a/test/test.js +++ b/test/test.js @@ -1026,7 +1026,7 @@ var largeStack = new mapCaches.Stack(pairs), length = pairs ? pairs.length : 0; - lodashStable.times(LARGE_ARRAY_SIZE - length + 1, function() { + lodashStable.times(LARGE_ARRAY_SIZE - length, function() { largeStack.set({}, {}); });