#FEATURE by stefan
authorStefan Vogel <sv@exept.de>
Fri, 13 Jul 2018 12:09:40 +0200
changeset 23207 37d3c6400f95
parent 23206 e291c84f8f11
child 23209 fe7673542e5f
#FEATURE by stefan class: Set added: #replaceAll:with:
Set.st
--- a/Set.st	Fri Jul 13 11:13:02 2018 +0200
+++ b/Set.st	Fri Jul 13 12:09:40 2018 +0200
@@ -540,6 +540,16 @@
     ^ oldObjectArg
 !
 
+replaceAll:oldObject with:newObject
+    "replace all oldObjects by newObject in the receiver."
+
+    self 
+        remove:oldObject ifAbsent:[];
+        addOrReplace:newObject.
+
+    "Created: / 13-07-2018 / 12:04:31 / Stefan Vogel"
+!
+
 safeRemove:oldObject 
     "remove the element, oldObject from the collection.
      Return the element 
@@ -886,7 +896,6 @@
 ! !
 
 
-
 !Set methodsFor:'obsolete set operations'!
 
 + aCollection