File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 38
38
(if (and (< i limit) (.hasNext it))
39
39
(let [x (.next it)]
40
40
(recur (inc i) (inc-if n (pred x))))
41
- [n (/ n i)]))))
41
+ [n (if ( pos? i) ( / n i) 0.0 )]))))
42
42
43
43
(defn- bounded-count [limit coll]
44
44
(first (count-pred (constantly true ) limit coll)))
138
138
(when (list-of-tuples? coll)
139
139
(let [cnt (bounded-count *size-cutoff* coll)
140
140
all (into [] (take *size-cutoff*) coll)
141
- longest (min 20 (apply max (map count all)))]
141
+ longest (->> all
142
+ (keep #(when (instance? List %) (bounded-count 20 %)))
143
+ (apply max)
144
+ (min 20 ))]
142
145
(non-nil-hmap
143
146
:cutoff? (when (>= cnt *size-cutoff*) true )
144
147
:count cnt
148
+ :types (*frequencies (map type coll))
145
149
:tuples (mapv (fn [i]
146
150
(basic-list-stats
147
151
(mapv #(when (vector? %) (nth % i nil )) all)
155
159
(non-nil-hmap
156
160
:cutoff? (when (>= cnt *size-cutoff*) true )
157
161
:count cnt
162
+ :types (*frequencies (map type coll))
158
163
:by-key (into {}
159
164
(for [k ks]
160
165
(let [kcoll (mapv #(get % k) coll)]
You can’t perform that action at this time.
0 commit comments