duplicate value in variable (#22390)
BIKI DAS committed
Oct 11, 2021 at 18:50 UTC
55d75005bc26aa41cddc090273f82aa106729fb8
1 file changed
+3
-2
packages/shared/shallowEqual.js
+3
-2
@@ -38,9 +38,10 @@ function shallowEqual(objA: mixed, objB: mixed): boolean {
38
39
// Test for A's keys different from B.
40
for (let i = 0; i < keysA.length; i++) {
41
+ const currentKey = keysA[i];
42
if (
42
- !hasOwnProperty.call(objB, keysA[i]) ||
43
- !is(objA[keysA[i]], objB[keysA[i]])
43
+ !hasOwnProperty.call(objB, currentKey) ||
44
+ !is(objA[currentKey], objB[currentKey])
45
) {
46
return false;
47
}