Skip to content

Commit 9c389da

Browse files
committed
Inline update-in-path
1 parent e9f5306 commit 9c389da

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/rewrite_clj/zip/utils.clj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@
33

44
;; ## Remove
55

6-
(defn- update-in-path
7-
[loc k f]
8-
(if-let [v (get loc k)]
9-
(assoc loc :changed? true k (f v))
10-
loc))
11-
126
(defn remove-right
137
"Remove right sibling of the current node (if there is one)."
14-
[loc]
15-
(update-in-path loc :right next))
8+
[{[r & rs] :right :as loc}]
9+
(assoc loc
10+
:right rs
11+
:changed? true))
1612

1713
(defn remove-left
1814
"Remove left sibling of the current node (if there is one)."

0 commit comments

Comments
 (0)