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 3838 (if (and (< i limit) (.hasNext it))
3939 (let [x (.next it)]
4040 (recur (inc i) (inc-if n (pred x))))
41- [n (/ n i)]))))
41+ [n (if ( pos? i) ( / n i) 0.0 )]))))
4242
4343(defn- bounded-count [limit coll]
4444 (first (count-pred (constantly true ) limit coll)))
138138 (when (list-of-tuples? coll)
139139 (let [cnt (bounded-count *size-cutoff* coll)
140140 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 ))]
142145 (non-nil-hmap
143146 :cutoff? (when (>= cnt *size-cutoff*) true )
144147 :count cnt
148+ :types (*frequencies (map type coll))
145149 :tuples (mapv (fn [i]
146150 (basic-list-stats
147151 (mapv #(when (vector? %) (nth % i nil )) all)
155159 (non-nil-hmap
156160 :cutoff? (when (>= cnt *size-cutoff*) true )
157161 :count cnt
162+ :types (*frequencies (map type coll))
158163 :by-key (into {}
159164 (for [k ks]
160165 (let [kcoll (mapv #(get % k) coll)]
You can’t perform that action at this time.
0 commit comments