Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

The fn->comparator call should be lifted:

(sort (fn [x y] ((fn->comparator comp) (keyfn x) (keyfn y))) coll)

(let [comparator (fn->comparator comp)] (sort (fn [x y] (comparator (keyfn x) (keyfn y))) coll))

Also, fn->comparator is again called on the function in {{sort}}, not sure how to avoid that unless we copy the sort code into {{sort-by}}.

3 Answers

0 votes
by

Comment made by: mfikes

CLJS-2045.patch added to Patch Tender (i)

0 votes
by

Comment made by: mfikes

CLJS-2045.patch passes CI and Canary (/)

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2045 (reported by aralo)
...