Skip to content

Commit

Permalink
Merge pull request #674 from bsless/faster-strip-extra-keys
Browse files Browse the repository at this point in the history
Speed up strip-extra-keys-transformer
  • Loading branch information
ikitommi authored May 27, 2022
2 parents 7ef1f23 + a785103 commit 384e31b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/malli/transform.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
(let [transform {:compile (fn [schema _]
(when (accept schema)
(when-let [ks (some->> schema m/entries (map first) seq set)]
(fn [x] (reduce (fn [acc k] (if-not (ks k) (dissoc acc k) acc)) x (keys x))))))}]
(fn [x] (reduce-kv (fn [acc k _] (if-not (ks k) (dissoc acc k) acc)) x x)))))}]
(transformer
{:decoders {:map transform}
:encoders {:map transform}}))))
Expand Down

0 comments on commit 384e31b

Please sign in to comment.