mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
Statically def transducer
Eliminates allocation and friendlier to JIT
This commit is contained in:
parent
59642e51f1
commit
61783e4c81
1 changed files with 3 additions and 1 deletions
|
|
@ -11,9 +11,11 @@
|
||||||
[m]
|
[m]
|
||||||
(persistent! (reduce-kv keywordize-kv (transient (empty m)) m)))
|
(persistent! (reduce-kv keywordize-kv (transient (empty m)) m)))
|
||||||
|
|
||||||
|
(def ^:private keywordize-xf (map -keywordize))
|
||||||
|
|
||||||
(defn- -keywordize-default
|
(defn- -keywordize-default
|
||||||
[coll]
|
[coll]
|
||||||
(into (empty coll) (map -keywordize) coll))
|
(into (empty coll) keywordize-xf coll))
|
||||||
|
|
||||||
(doseq [type [clojure.lang.PersistentHashSet
|
(doseq [type [clojure.lang.PersistentHashSet
|
||||||
clojure.lang.PersistentVector
|
clojure.lang.PersistentVector
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue