[BUG]Collection>>removeAll:

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu Aug 15 23:32:54 UTC 2002


Bergel Alexandre <bergel at iam.unibe.ch> wrote:
	t := #(1 2 3 4) asOrderedCollection.
	t removeAll: t
	-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
	=> an OrderedCollection(2 4)
	
Definitely a bug.

The simplest change is

	removeAll: aCollection
	    |c|
	    
	    (c := aCollection) == self ifTrue: [c := c copy].
	    c do: [:each | self remove: each].
	    ^c

(preserving, of course, the comments I was too lazy to re-type).
I've now sent this as a [FIX].



More information about the Squeak-dev mailing list