@@ -9308,7 +9308,10 @@ reduces them without incurring seq initialization"
93089308
93099309 ICollection
93109310 (-conj [coll o]
9311- (PersistentHashSet. meta (assoc hash-map o nil ) nil ))
9311+ (let [m (-assoc hash-map o nil )]
9312+ (if (identical? m hash-map)
9313+ coll
9314+ (PersistentHashSet. meta m nil ))))
93129315
93139316 IEmptyableCollection
93149317 (-empty [coll] (-with-meta (.-EMPTY PersistentHashSet) meta))
@@ -9345,7 +9348,10 @@ reduces them without incurring seq initialization"
93459348
93469349 ISet
93479350 (-disjoin [coll v]
9348- (PersistentHashSet. meta (-dissoc hash-map v) nil ))
9351+ (let [m (-dissoc hash-map v)]
9352+ (if (identical? m hash-map)
9353+ coll
9354+ (PersistentHashSet. meta m nil ))))
93499355
93509356 IFn
93519357 (-invoke [coll k]
@@ -9463,7 +9469,10 @@ reduces them without incurring seq initialization"
94639469
94649470 ICollection
94659471 (-conj [coll o]
9466- (PersistentTreeSet. meta (assoc tree-map o nil ) nil ))
9472+ (let [m (-assoc tree-map o nil )]
9473+ (if (identical? m tree-map)
9474+ coll
9475+ (PersistentTreeSet. meta m nil ))))
94679476
94689477 IEmptyableCollection
94699478 (-empty [coll] (PersistentTreeSet. meta (-empty tree-map) 0 ))
@@ -9517,7 +9526,10 @@ reduces them without incurring seq initialization"
95179526
95189527 ISet
95199528 (-disjoin [coll v]
9520- (PersistentTreeSet. meta (dissoc tree-map v) nil ))
9529+ (let [m (-dissoc tree-map v)]
9530+ (if (identical? m tree-map)
9531+ coll
9532+ (PersistentTreeSet. meta m nil ))))
95219533
95229534 IFn
95239535 (-invoke [coll k]
@@ -13002,7 +13014,10 @@ reduces them without incurring seq initialization"
1300213014
1300313015 ISet
1300413016 (-disjoin [coll v]
13005- (Set. meta (-dissoc hash-map v) nil ))
13017+ (let [new-hash-map (-dissoc hash-map v)]
13018+ (if (identical? new-hash-map hash-map)
13019+ coll
13020+ (Set. meta new-hash-map nil ))))
1300613021
1300713022 IEditableCollection
1300813023 (-as-transient [coll]
0 commit comments