Use when-not instead of single branch if-not and do

This commit is contained in:
Daniel Compton 2017-09-01 14:28:51 +12:00
parent 8e3279c39c
commit b345eb824e
1 changed files with 12 additions and 13 deletions

View File

@ -148,8 +148,7 @@
(defn add-filter [filter-items filter-input filter-type]
;; prevent duplicate filter strings
(if-not (some #(= filter-input (:query %)) @filter-items)
(do
(when-not (some #(= filter-input (:query %)) @filter-items)
;; if existing, remove prior filter for :slower-than
(when (and (= :slower-than filter-type)
(some #(= filter-type (:filter-type %)) @filter-items))
@ -160,7 +159,7 @@
:query (if (= filter-type :contains)
(str/lower-case filter-input)
(js/parseFloat filter-input))
:filter-type filter-type}))))
:filter-type filter-type})))
(defn render-traces [showing-traces filter-items filter-input trace-detail-expansions]
(doall