Skip to content

Commit

Permalink
perf(proxy): avoid has where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Dec 16, 2018
1 parent 1803dd8 commit 4b9b637
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/immer.js
Expand Up @@ -4,7 +4,6 @@ import {generatePatches} from "./patches"
import {
assign,
each,
has,
is,
isDraft,
isDraftable,
Expand Down Expand Up @@ -174,7 +173,7 @@ export class Immer {
// prettier-ignore
parent[prop] =
// Patches are never generated for assigned properties.
patches && parent === root && !(state && has(state.assigned, prop))
patches && parent === root && !(state && state.assigned[prop])
? this.finalize(value, path.concat(prop), patches, inversePatches)
: this.finalize(value)

Expand Down

0 comments on commit 4b9b637

Please sign in to comment.