Skip to content

Commit 55d7500

Browse files
authored
duplicate value in variable (#22390)
1 parent afcb9cd commit 55d7500

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/shared/shallowEqual.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ function shallowEqual(objA: mixed, objB: mixed): boolean {
3838

3939
// Test for A's keys different from B.
4040
for (let i = 0; i < keysA.length; i++) {
41+
const currentKey = keysA[i];
4142
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])
4445
) {
4546
return false;
4647
}

0 commit comments

Comments
 (0)