Skip to content

Commit 400e878

Browse files
[analytics] Fix autoboxing warning
1 parent 13a132e commit 400e878

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/orchard/inspect/analytics.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
(defn- numbers-stats [^Iterable coll]
5858
(let [it (.iterator coll)]
59-
(loop [i 0, hi nil, lo nil, zeros 0, n 0, sum 0]
59+
(loop [i 0, hi nil, lo nil, zeros 0, n 0, sum 0.0]
6060
(if (and (< i *size-cutoff*) (.hasNext it))
6161
(let [x (.next it)]
6262
(if (number? x)
@@ -65,10 +65,10 @@
6565
(if (nil? lo) x (min lo x))
6666
(inc-if zeros (zero? x))
6767
(inc n)
68-
(+ sum x))
68+
(+ sum (double x)))
6969
(recur (inc i) hi lo zeros n sum)))
7070
(when (> n 0)
71-
{:n n, :zeros zeros, :max hi, :min lo, :mean (float (/ sum n))})))))
71+
{:n n, :zeros zeros, :max hi, :min lo, :mean (/ sum n)})))))
7272

7373
(def ^:private ^java.nio.charset.CharsetEncoder ascii-enc
7474
(.newEncoder (java.nio.charset.Charset/forName "US-ASCII")))

0 commit comments

Comments
 (0)