From 3ec037cdf49078df627b1d8d76b9ad6f5f08998a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 19 Feb 2020 12:04:55 +0100 Subject: [PATCH] :zap: Improve performance of `concat` operation. --- common/uxbox/common/data.cljc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/uxbox/common/data.cljc b/common/uxbox/common/data.cljc index 4774241a5..ceaa4d409 100644 --- a/common/uxbox/common/data.cljc +++ b/common/uxbox/common/data.cljc @@ -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))