Skip to content

Commit

Permalink
perf(schema): parse pattern only when needed (#3871)
Browse files Browse the repository at this point in the history
  • Loading branch information
hchlq authored Jun 25, 2023
1 parent 7b74842 commit 7f6fed0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/json-schema/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ export const patchCompile = (
scope: any
) => {
traverse(sourceState, (value, pattern) => {
const path = FormPath.parse(pattern)
const compiled = compile(value, scope)
const key = path.segments[0]
if (compiled === undefined) return
const path = FormPath.parse(pattern)
const key = path.segments[0]
if (hasOwnProperty.call(targetState, key)) {
untracked(() => FormPath.setIn(targetState, path, compiled))
}
Expand Down

0 comments on commit 7f6fed0

Please sign in to comment.