File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 17
17
distinct))
18
18
19
19
(defn- aliases-by-frequencies [libspecs]
20
- (->> libspecs
21
- (mapcat aliases) ; => [[str clojure.string] ...]
22
- (sort-by (comp str second))
23
- (group-by first) ; => {str [[str clojure.string] [str clojure.string]] ...}
24
- (map (comp seq frequencies second)) ; => (([[set clojure.set] 4] [set set] 1) ...)
25
- (map (partial sort-by second >)) ; by decreasing frequency
26
- (map (partial map first)) ; drop frequencies
27
- (map (fn [aliases] (list (ffirst aliases) (map second aliases))))
28
- (mapcat identity)
29
- (apply hash-map)))
20
+ (let [grouped (->> libspecs
21
+ (mapcat aliases) ; => [[str clojure.string] ...]
22
+ (sort-by (comp str second))
23
+ (group-by first) ; => {str [[str clojure.string] [str clojure.string]] ...}
24
+ )]
25
+ (into {}
26
+ (comp (map (comp seq frequencies second)) ; => (([[set clojure.set] 4] [set set] 1) ...)
27
+ (map (partial sort-by second >)) ; by decreasing frequency
28
+ (map (partial map first)) ; drop frequencies
29
+ (map (fn [aliases]
30
+ [(ffirst aliases),
31
+ (mapv second aliases)])))
32
+ grouped)))
30
33
31
34
(defn- get-cached-libspec [^File f lang]
32
35
(when-let [[ts v] (get-in @cache [(.getAbsolutePath f) lang])]
You can’t perform that action at this time.
0 commit comments