@@ -12603,10 +12603,14 @@ reduces them without incurring seq initialization"
1260312603 (let [k (if-not (keyword? k) k (keyword->obj-map-key k))]
1260412604 (if (string? k)
1260512605 (if-not (nil? (scan-array 1 k strkeys))
12606- (let [new-strobj (obj-clone strobj strkeys)]
12607- (gobject/set new-strobj k v)
12608- (ObjMap. meta strkeys new-strobj nil )) ; overwrite
12609- (let [new-strobj (obj-clone strobj strkeys) ; append
12606+ (if (identical? v (gobject/get strobj k))
12607+ coll
12608+ ; overwrite
12609+ (let [new-strobj (obj-clone strobj strkeys)]
12610+ (gobject/set new-strobj k v)
12611+ (ObjMap. meta strkeys new-strobj nil )))
12612+ ; append
12613+ (let [new-strobj (obj-clone strobj strkeys)
1261012614 new-keys (aclone strkeys)]
1261112615 (gobject/set new-strobj k v)
1261212616 (.push new-keys k)
@@ -12812,10 +12816,12 @@ reduces them without incurring seq initialization"
1281212816 i (scan-array-equiv 2 k new-bucket)]
1281312817 (aset new-hashobj h new-bucket)
1281412818 (if (some? i)
12815- (do
12816- ; found key, replace
12817- (aset new-bucket (inc i) v)
12818- (HashMap. meta count new-hashobj nil ))
12819+ (if (identical? v (aget new-bucket (inc i)))
12820+ coll
12821+ (do
12822+ ; found key, replace
12823+ (aset new-bucket (inc i) v)
12824+ (HashMap. meta count new-hashobj nil )))
1281912825 (do
1282012826 ; did not find key, append
1282112827 (.push new-bucket k v)
@@ -12954,7 +12960,10 @@ reduces them without incurring seq initialization"
1295412960
1295512961 ICollection
1295612962 (-conj [coll o]
12957- (Set. meta (assoc hash-map o o) nil ))
12963+ (let [new-hash-map (assoc hash-map o o)]
12964+ (if (identical? new-hash-map hash-map)
12965+ coll
12966+ (Set. meta new-hash-map nil ))))
1295812967
1295912968 IEmptyableCollection
1296012969 (-empty [coll] (with-meta (. Set -EMPTY) meta))
0 commit comments