0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

Improve performance of concat operation.

This commit is contained in:
Andrey Antukh 2020-02-19 12:04:55 +01:00
parent 86ba4fd083
commit 3ec037cdf4

View file

@ -28,12 +28,12 @@
(defn concat
[& colls]
(loop [result (first colls)
(loop [result (transient (first colls))
colls (rest colls)]
(if (seq colls)
(recur (reduce conj result (first colls))
(recur (reduce conj! result (first colls))
(rest colls))
result)))
(persistent! result))))
(defn enumerate
([items] (enumerate items 0))