Skip to content
Myr

nit: simplify hasObjectChanges loop

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by aleclarson · committed by aleclarson · parent c9e1d98 · Browse files · 1 file+2 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−4 removed

  • other:+2 added−4 removed

1 file+2 added−4 removed

modified:src/es5.js+2 added-4 removed
171 unmodified lines
172173 // Search for added keys. Start at the back, because non-numeric keys174 // are ordered by time of definition on the object.175 const keys = Object.keys(proxy)176 for (let i = keys.length; i !== 0; ) {177 const key = keys[--i]178176 for (let i = keys.length - 1; i >= 0; i--) {177 // The `undefined` check is a fast path for pre-existing keys.180 if (base[key] === undefined && !has(base, key)) {178 if (base[keys[i]] === undefined && !has(base, keys[i])) {179 return true180 }181 }182
70 unmodified lines