Skip to content

Commit

Permalink
[pipeline] Use conj! as the default pipeline rf
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Oct 8, 2024
1 parent 352d181 commit 7c4d1cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/toucan2/pipeline.clj
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,10 @@
"The default reducing function for all query types unless otherwise specified. Returns realized maps (by default, Toucan
2 instances)."
[_query-type]
((map realize/realize) conj))
(fn
([] (transient []))
([acc] (persistent! acc))
([acc x] (conj! acc (realize/realize x)))))

(defn ^:no-doc first-result-xform-fn
"Return a transducer that transforms a reducing function `rf` so it always takes at most one value and returns the first
Expand Down

0 comments on commit 7c4d1cc

Please sign in to comment.