Skip to content

Commit 94a49a2

Browse files
committed
precompute more
1 parent a59b475 commit 94a49a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/malli/core.cljc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,12 +1944,13 @@
19441944
(let [ref-validators *ref-validators*
19451945
id (-identify-ref-schema this)]
19461946
(if lazy
1947-
(let [vol (or (ref-validators id)
1948-
(volatile! nil))]
1947+
(let [rv (ref-validators id)
1948+
vol (or rv (volatile! nil))
1949+
reg (when-not rv (-registry options))]
19491950
(fn [x]
19501951
(if-let [f @vol]
19511952
(f x)
1952-
(let [s (schema (mr/-schema (-registry options) ref) options)
1953+
(let [s (schema (mr/-schema reg ref) options)
19531954
f (binding [*ref-validators* (assoc ref-validators id vol)]
19541955
(-validator s))]
19551956
(vreset! vol f)

0 commit comments

Comments
 (0)