Skip to content

Commit 86a6fd7

Browse files
committed
fix deep concats
1 parent e63b08b commit 86a6fd7

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ pom.xml.asc
99
/.nrepl-port
1010
.hgignore
1111
.hg/
12+
.#*

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject vixen "0.1.1"
1+
(defproject vixen "0.1.2"
22
:description "Manipulate DOM"
33
:url "http://github.com/zensight/vixen"
44
:plugins [[cider/cider-nrepl "0.12.0"]]

src/vixen/core.clj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,13 @@
140140
[[n p] & others] [[node path]]]
141141
(if n
142142
(let [newly (selector n p vix)]
143-
(recur (concat found newly)
144-
(concat others
145-
(map-indexed (fn [i child]
146-
[child (conj p i)])
147-
(:content n)))))
143+
(recur (if (empty? newly) found (concat found newly))
144+
(if (empty? (:content n)
145+
others
146+
(concat others
147+
(map-indexed (fn [i child]
148+
[child (conj p i)])
149+
(:content n)))))))
148150
found))))
149151

150152
(defn path->selector [path]

0 commit comments

Comments
 (0)