There is #removeAll.

You should also check out #keysAndValuesRemove:

Removing from a collection while iterating over it is dangerous.

> On 9 Apr 2018, at 10:00, Trussardi Dario Romano <dario.trussa...@tiscali.it> 
> wrote:
> 
> Ciao,
> 
>       in the Pharo 4.0 image i have a IdentityDictionary with ten items.
> 
>       Now when i reset the dictionary the system behaves as follows:
> 
>       Version A)  resetAllLocks
>       
>                               locks keysAndValuesDo:[:k :v | locks removeKey: 
> k ifAbsent: [self halt]]
> 
> 
>               Not all items are removed fro the dictionary.
> 
> 
>       Version B) resetAllLocks
>       
>                               locks keys do:[:k | locks removeKey: k 
> ifAbsent: [self halt]]
> 
>               All the items are always removed.
> 
>       
>       Considerations about it?
> 
>       Thanks,
>                       
>               Dario
> 


Reply via email to