From a6ead181216f07b119ac4c9c23cde31e54156174 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 11 Sep 2015 12:57:34 -0700 Subject: [PATCH] Avoid deep crawl if `object` and `source` are strict equal. --- lodash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index e9837f83b..c56803d78 100644 --- a/lodash.js +++ b/lodash.js @@ -2475,7 +2475,7 @@ }; } return function(object) { - return baseIsMatch(object, source, matchData); + return object === source || baseIsMatch(object, source, matchData); }; } @@ -8599,7 +8599,7 @@ * // => false */ function isMatch(object, source) { - return baseIsMatch(object, source, getMatchData(source)); + return object === source || baseIsMatch(object, source, getMatchData(source)); } /**