Skip to content

Commit

Permalink
Statically def transducer
Browse files Browse the repository at this point in the history
Eliminates allocation and friendlier to JIT
  • Loading branch information
bsless committed Aug 25, 2024
1 parent 59642e5 commit 61783e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/reitit-core/src/reitit/walk.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
[m]
(persistent! (reduce-kv keywordize-kv (transient (empty m)) m)))

(def ^:private keywordize-xf (map -keywordize))

(defn- -keywordize-default
[coll]
(into (empty coll) (map -keywordize) coll))
(into (empty coll) keywordize-xf coll))

(doseq [type [clojure.lang.PersistentHashSet
clojure.lang.PersistentVector
Expand Down

0 comments on commit 61783e4

Please sign in to comment.