Skip to content

Commit 76c1a63

Browse files
thomasmulvaneyswannodette
authored andcommitted
CLJS-2080: Faster equiv-map
1 parent 48db4fa commit 76c1a63

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/main/cljs/cljs/core.cljs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5836,9 +5836,16 @@ reduces them without incurring seq initialization"
58365836
(when (and (map? y) (not (record? y)))
58375837
; assume all maps are counted
58385838
(when (== (count x) (count y))
5839-
(every? (fn [xkv] (= (get y (first xkv) never-equiv)
5840-
(second xkv)))
5841-
x)))))
5839+
(if (satisfies? IKVReduce x)
5840+
(reduce-kv (fn [_ k v]
5841+
(if (= (get y k never-equiv) v)
5842+
true
5843+
(reduced false)))
5844+
true
5845+
x)
5846+
(every? (fn [xkv] (= (get y (first xkv) never-equiv)
5847+
(second v)))
5848+
x))))))
58425849

58435850

58445851
(defn- scan-array [incr k array]

0 commit comments

Comments
 (0)