Skip to content
Browse files

CLJS-3164: Optimize assoc on IAssociative values

  • Loading branch information...
mfikes committed Sep 11, 2019
1 parent d79eda3 commit 5ad96a8b3ae2e3616a19715ba9ba2471a36933a2
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/main/cljs/cljs/core.cljs
@@ -1973,9 +1973,11 @@ reduces them without incurring seq initialization"
val(s). When applied to a vector, returns a new vector that
contains val at index. Note - index must be <= (count vector)."
([coll k v]
(if-not (nil? coll)
(-assoc coll k v)
(array-map k v)))
(if (implements? IAssociative coll)
(-assoc coll k v)
(if-not (nil? coll)
(-assoc coll k v)
(array-map k v))))
([coll k v & kvs]
(let [ret (assoc coll k v)]
(if kvs

0 comments on commit 5ad96a8

Please sign in to comment.
You can’t perform that action at this time.