mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
⚡ Improve performance of concat
operation.
This commit is contained in:
parent
86ba4fd083
commit
3ec037cdf4
1 changed files with 3 additions and 3 deletions
|
@ -28,12 +28,12 @@
|
||||||
|
|
||||||
(defn concat
|
(defn concat
|
||||||
[& colls]
|
[& colls]
|
||||||
(loop [result (first colls)
|
(loop [result (transient (first colls))
|
||||||
colls (rest colls)]
|
colls (rest colls)]
|
||||||
(if (seq colls)
|
(if (seq colls)
|
||||||
(recur (reduce conj result (first colls))
|
(recur (reduce conj! result (first colls))
|
||||||
(rest colls))
|
(rest colls))
|
||||||
result)))
|
(persistent! result))))
|
||||||
|
|
||||||
(defn enumerate
|
(defn enumerate
|
||||||
([items] (enumerate items 0))
|
([items] (enumerate items 0))
|
||||||
|
|
Loading…
Add table
Reference in a new issue