From 70147396a4fdc4ac586357e13c97999a05e4d859 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 17 Sep 2013 22:53:10 -0700 Subject: [PATCH] Add `mid` check to `createCache` bailout. --- lodash.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 14d3ea987..f054783d4 100644 --- a/lodash.js +++ b/lodash.js @@ -277,9 +277,11 @@ var index = -1, length = array.length, first = array[0], + mid = array[(length / 2) | 0], last = array[length - 1]; - if (first && typeof first == 'object' && last && typeof last == 'object') { + if (first && typeof first == 'object' && + mid && typeof mid == 'object' && last && typeof last == 'object') { return false; } var cache = getObject();