added default sorting back in.

This commit is contained in:
Bryce Covert
2020-09-01 22:47:03 -07:00
parent 088d78830a
commit abfcb37078
6 changed files with 19 additions and 12 deletions

View File

@@ -789,7 +789,8 @@
(:sort args)))
(defn apply-sort-3 [args results]
(let [sort-bys (or (:sort args) [])
(let [sort-bys (conj (:sort args)
{:sort-key "default" :asc true})
length (count sort-bys)
comparator (fn [xs ys]
(reduce
@@ -797,6 +798,7 @@
(let [comparison (if (:asc (sort-bys i))
(compare (nth xs i) (nth ys i))
(compare (nth ys i) (nth xs i)))]
(if (not= 0 comparison)
(reduced comparison)
0)))