Chris Muller uploaded a new version of Collections to project The Trunk: http://source.squeak.org/trunk/Collections-cmm.984.mcz
==================== Summary ====================
Name: Collections-cmm.984 Author: cmm Time: 2 February 2022, 3:54:20.944662 pm UUID: 88a7a4ca-9648-4dce-bb89-f9c857baec29 Ancestors: Collections-mt.983
- Avoid unnecessary garbage in #= for OrderedDictionary comparisons. - Delegate #species comparison via #=. - #hasEqualElements: API compatibility with SequenceableCollection.
=============== Diff against Collections-mt.983 ===============
Item was added: + ----- Method: OrderedDictionary>>hasEqualElements: (in category 'comparing') ----- + hasEqualElements: anOrderedDictionary + "Answer whether my elements are the same as anOrderedDictionary, and in the same order." + | index | + self size = anOrderedDictionary size ifFalse: [ ^ false ]. + index := 0. + self associationsDo: + [ : eachMyAssociation | + (anOrderedDictionary + atIndex: (index:=index+1) + ifAbsent: [ ^ false ]) = eachMyAssociation ifFalse: [ ^ false ] ]. + ^ true!
Item was changed: ----- Method: PluggableDictionary>>= (in category 'comparing') ----- = anObject "Two dictionaries are equal if (a) they are the same 'kind' of thing. (b) they have the same set of keys. (c) for each (common) key, they have the same value"
self == anObject ifTrue: [ ^true ]. + self species = anObject species ifFalse: [ ^false ]. - self species == anObject species ifFalse: [ ^false ]. hashBlock = anObject hashBlock ifFalse: [ ^false ]. equalBlock = anObject equalBlock ifFalse: [ ^false ]. + ^ self hasEqualElements: anObject! - self size = anObject size ifFalse: [ ^false ]. - self associationsDo: [ :association | - (anObject at: association key ifAbsent: [ ^false ]) = association value - ifFalse: [ ^false ] ]. - ^true!
Item was added: + ----- Method: PluggableDictionary>>hasEqualElements: (in category 'comparing') ----- + hasEqualElements: aDictionary + "Answer whether my elements are the same as those of aDictionary." + self size = aDictionary size ifFalse: [ ^ false ]. + self associationsDo: + [ : association | + (aDictionary + at: association key + ifAbsent: [ ^ false ]) = association value ifFalse: [ ^ false ] ]. + ^ true!
packages@lists.squeakfoundation.org