Apply a change suggested by Miikka Koskinen.

This commit is contained in:
Vincent Cantin 2019-01-22 08:22:48 +08:00
parent b77115850f
commit fdf249a959

View file

@ -66,16 +66,14 @@
coerce (into [] (keep #(coerce % opts))))) coerce (into [] (keep #(coerce % opts)))))
(defn path-conflicting-routes [routes] (defn path-conflicting-routes [routes]
(let [conflicting-routes (-> (into {}
(into {} (comp (map-indexed (fn [index route]
(comp (map-indexed (fn [index route] [route (into #{}
[route (into #{} (filter #(impl/conflicting-routes? route %))
(filter #(impl/conflicting-routes? route %)) (subvec routes (inc index)))]))
(subvec routes (inc index)))])) (filter (comp seq second)))
(filter (comp seq second))) routes)
routes)] (not-empty)))
(when (seq conflicting-routes)
conflicting-routes)))
(defn conflicting-paths [conflicts] (defn conflicting-paths [conflicts]
(->> (for [[p pc] conflicts] (->> (for [[p pc] conflicts]