From efdec208fda1ce923f8de0170598988b8f8920f6 Mon Sep 17 00:00:00 2001 From: Wyatt Cready Date: Wed, 14 Dec 2016 13:55:41 -0500 Subject: [PATCH] Also attempt to exit early when iterating b's keys --- src/utils/shallowEqual.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/shallowEqual.js b/src/utils/shallowEqual.js index 9980e83f5..2bbefefac 100644 --- a/src/utils/shallowEqual.js +++ b/src/utils/shallowEqual.js @@ -12,8 +12,8 @@ export default function shallowEqual(a, b) { } for (let key in b) { - if (hasOwn.call(b, key)) countB++ + if (hasOwn.call(b, key) && countA < ++countB) return false } - return countA === countB + return true }