Skip to content

Commit 58ae5ed

Browse files
committedNov 22, 2019
Inline this function.
1 parent 1186016 commit 58ae5ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/utils/shallowEqual.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const hasOwn = Object.prototype.hasOwnProperty
2-
31
function is(x, y) {
42
if (x === y) {
53
return x !== 0 || y !== 0 || 1 / x === 1 / y
@@ -26,7 +24,10 @@ export default function shallowEqual(objA, objB) {
2624
if (keysA.length !== keysB.length) return false
2725

2826
for (let i = 0; i < keysA.length; i++) {
29-
if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
27+
if (
28+
!Object.prototype.hasOwnProperty.call(objB, keysA[i]) ||
29+
!is(objA[keysA[i]], objB[keysA[i]])
30+
) {
3031
return false
3132
}
3233
}

0 commit comments

Comments
 (0)