Skip to content

Commit 046442e

Browse files
committed
patch: use disj instead of set/difference
1 parent 0fb6f06 commit 046442e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/editscript/patch.cljc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
;;
1010

1111
(ns ^:no-doc editscript.patch
12-
(:require [clojure.set :as set]
13-
[editscript.edit :as e]
12+
(:require [editscript.edit :as e]
1413
[editscript.util.common :as c]
1514
[clojure.string :as s]))
1615

@@ -31,7 +30,7 @@
3130
;;if p is ##NaN, then p cannot be found in x, for (= ##NaN ##NaN) is false!
3231
:map (dissoc x p)
3332
:vec (into (subvec x 0 p) (subvec x (inc ^long p)))
34-
:set (set/difference x #{p})
33+
:set (disj x p)
3534
:lst (->> (split-at p x)
3635
(#(concat (nth % 0) (next (nth % 1))))
3736
(apply list))))
@@ -77,7 +76,7 @@
7776
(case (e/get-type x)
7877
:map (assoc x p v)
7978
:vec (assoc x p v)
80-
:set (-> x (set/difference #{p}) (conj v))
79+
:set (-> x (disj p) (conj v))
8180
:lst (->> (split-at p x)
8281
(#(concat (nth % 0) (conj (rest (nth % 1)) v)))
8382
(apply list))))

0 commit comments

Comments
 (0)