Skip to content

Commit

Permalink
[nested-grid] revert descendant?
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Aug 21, 2024
1 parent 025db22 commit 12f772d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/re_com/nested_grid.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,8 @@
"selected, then only 2 cells are exported."]}]))

(defn descendant? [path-a path-b]
(let [a-ct (count path-a)
b-ct (count path-b)]
(and (not (>= a-ct b-ct))
(= path-a (subvec path-b 0 a-ct)))))
(and (not (>= (count path-a) (count path-b)))
(= path-a (vec (take (count path-a) path-b)))))

(defn ancestor? [path-a path-b]
(descendant? path-b path-a))
Expand Down

0 comments on commit 12f772d

Please sign in to comment.