implement ALL NONE removal for some of default cases
This commit is contained in:
parent
fca11410b4
commit
9617aa1931
1 changed files with 10 additions and 7 deletions
|
|
@ -156,17 +156,20 @@
|
||||||
;; reduce-kv is much faster than doing r/map through call to (into ...)
|
;; reduce-kv is much faster than doing r/map through call to (into ...)
|
||||||
(reduce-kv
|
(reduce-kv
|
||||||
(fn [m k v]
|
(fn [m k v]
|
||||||
;;TODO: need to handle NONE here
|
(let [newkv (next-fn [k v])]
|
||||||
(let [[newk newv] (next-fn [k v])]
|
(if (identical? newkv i/NONE)
|
||||||
(assoc m newk newv)))
|
m
|
||||||
|
(assoc m (nth newkv 0) (nth newkv 1)))))
|
||||||
|
|
||||||
empty-structure
|
empty-structure
|
||||||
structure)
|
structure)
|
||||||
|
|
||||||
|
|
||||||
:else
|
:else
|
||||||
;;TODO: need to handle NONE here
|
(->> structure
|
||||||
(->> structure (r/map next-fn) (into empty-structure))))))
|
(r/map next-fn)
|
||||||
|
(r/filter #(-> % (identical? i/NONE) not))
|
||||||
|
(into empty-structure))))))
|
||||||
|
|
||||||
|
|
||||||
#?(:cljs default)
|
#?(:cljs default)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue