Skip to content

Commit

Permalink
simpler loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Sep 4, 2023
1 parent 1d0f512 commit 85de30f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/malli/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,13 @@
(-intercepting this-transformer
(if (= :decode method)
(fn [x]
(key (reduce-kv
(fn [acc i transformer]
(let [x* (transformer (val acc))]
(if ((nth validators i) x*)
(reduced (miu/-tagged x* nil))
(miu/-tagged (or (key acc) x*) x))))
(miu/-tagged nil x) transformers)))
(reduce-kv
(fn [acc i transformer]
(let [x* (transformer x)]
(if ((nth validators i) x*)
(reduced x*)
(or acc x*))))
nil transformers))
(fn [x]
(reduce-kv
(fn [x i validator] (if (validator x) (reduced ((nth transformers i) x)) x))
Expand Down

0 comments on commit 85de30f

Please sign in to comment.