fix subselect changing first matched element to nil when transformed to empty sequence
This commit is contained in:
parent
6a5054feea
commit
7b646ca566
3 changed files with 4 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
* Add `vterminal` that takes in collected vals as vector in first argument rather than spliced into argument list.
|
* Add `vterminal` that takes in collected vals as vector in first argument rather than spliced into argument list.
|
||||||
* Add `compact` navigator. After each step of navigation of its subpath, `compact` removes the collection if it's empty.
|
* Add `compact` navigator. After each step of navigation of its subpath, `compact` removes the collection if it's empty.
|
||||||
* Change `terminal` to be a no-op on select codepath
|
* Change `terminal` to be a no-op on select codepath
|
||||||
|
* Bug fix: `subselect`/`filterer` removes first matched element instead of setting to nil when transformed to empty sequence
|
||||||
|
|
||||||
## 1.0.5
|
## 1.0.5
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -895,7 +895,7 @@
|
||||||
values-to-insert (i/mutable-cell transformed)]
|
values-to-insert (i/mutable-cell transformed)]
|
||||||
(compiled-transform late
|
(compiled-transform late
|
||||||
(fn [_] (let [vs (i/get-cell values-to-insert)]
|
(fn [_] (let [vs (i/get-cell values-to-insert)]
|
||||||
(if vs
|
(if (seq vs)
|
||||||
(do (i/update-cell! values-to-insert next)
|
(do (i/update-cell! values-to-insert next)
|
||||||
(first vs))
|
(first vs))
|
||||||
NONE
|
NONE
|
||||||
|
|
|
||||||
|
|
@ -1535,6 +1535,8 @@
|
||||||
|
|
||||||
(deftest filterer-remove-test
|
(deftest filterer-remove-test
|
||||||
(is (= [1 :a 3 5] (setval (s/filterer even?) [:a] [1 2 3 4 5])))
|
(is (= [1 :a 3 5] (setval (s/filterer even?) [:a] [1 2 3 4 5])))
|
||||||
|
(is (= [1 3 5] (setval (s/filterer even?) [] [1 2 3 4 5])))
|
||||||
|
(is (= [1 3 5] (setval (s/filterer even?) nil [1 2 3 4 5])))
|
||||||
)
|
)
|
||||||
|
|
||||||
(deftest helper-preds-test
|
(deftest helper-preds-test
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue