From 3c569148227ba3e3253d8a9b3c9458973d00794b Mon Sep 17 00:00:00 2001 From: jdalton Date: Wed, 1 Apr 2015 00:08:31 -0700 Subject: [PATCH] Simplify `isLoose` check in `baseIsEqualDeep`. --- lodash.src.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index bd6e592d4..8ab4bb4ec 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -2349,20 +2349,16 @@ if (isSameTag && !(objIsArr || objIsObj)) { return equalByTag(object, other, objTag); } - if (isLoose) { - if (!isSameTag && !(objIsObj && othIsObj)) { - return false; - } - } else { + if (!isLoose) { var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (valWrapped || othWrapped) { return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); } - if (!isSameTag) { - return false; - } + } + if (!isSameTag) { + return false; } // Assume cyclic values are equal. // For more information on detecting circular references see https://es5.github.io/#JO.