From 4a9b4a45dd3f10494f56f2e38b70e3f588c0eae1 Mon Sep 17 00:00:00 2001 From: Rom Grk Date: Thu, 29 May 2025 19:02:30 -0400 Subject: [PATCH] perf: inverse loop order --- compat/src/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat/src/util.js b/compat/src/util.js index 8ec376942b..460e492bcf 100644 --- a/compat/src/util.js +++ b/compat/src/util.js @@ -17,8 +17,8 @@ export function assign(obj, props) { * @returns {boolean} */ export function shallowDiffers(a, b) { - for (let i in a) if (i !== '__source' && !(i in b)) return true; - for (let i in b) if (i !== '__source' && a[i] !== b[i]) return true; + for (let i in a) if (i !== '__source' && a[i] !== b[i]) return true; + for (let i in b) if (i !== '__source' && !(i in a)) return true; return false; }