enhance: also replace distinct-by in deps/graph-parser & electron/search

This commit is contained in:
rcmerci
2022-12-19 23:39:39 +08:00
parent fa0a03263d
commit db7975d09f
3 changed files with 13 additions and 23 deletions

View File

@@ -5,7 +5,8 @@
["better-sqlite3" :as sqlite3]
[clojure.string :as string]
["electron" :refer [app]]
[electron.logger :as logger]))
[electron.logger :as logger]
[medley.core :as medley]))
(defonce databases (atom nil))
@@ -240,13 +241,7 @@
(defn distinct-by
[f col]
(reduce
(fn [acc x]
(if (some #(= (f x) (f %)) acc)
acc
(vec (conj acc x))))
[]
col))
(medley/distinct-by f (seq col)))
(defn search-blocks
":page - the page to specificly search on"