[BUG]Collection>>removeAll:

Ralph Johnson johnson at cs.uiuc.edu
Wed Aug 21 13:50:49 UTC 2002


My implementation of removeAll was wrong.  I forgot that I
shoul duse remove:ifAbsent: to handle the case where you
try to remove something twice or where the bounds have shrunk
and the collection can't find the element.  So, you can't ues
removeAll: but have to implement it yourself.

removeAll
  [self isEmpty] whileFalse: [self do: [:each | self remove: each ifAbsent: []]]



More information about the Squeak-dev mailing list