Skip to content

Commit ad6b4bc

Browse files
authored
improves performance for bulk import (#18)
1 parent 53a697e commit ad6b4bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/typesense/util.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"Take a vector of maps and returns json-line format.
2020
Returns an empty string if the vector is empty."
2121
[ms]
22-
(reduce #(str %1 (json/write-str %2) "\n") "" ms))
22+
(->> ms
23+
(map #(str (json/write-str %) \newline))
24+
str/join))
2325

2426
(defn json->map
2527
"Transforms json to a map.

0 commit comments

Comments
 (0)