[squeak-dev] The Trunk: Collections-mt.983.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Feb 2 19:53:52 UTC 2022


Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.983.mcz

==================== Summary ====================

Name: Collections-mt.983
Author: mt
Time: 2 February 2022, 8:53:50.38038 pm
UUID: 88b21e56-cd5d-6c4e-b4b1-03d25fb1d2ea
Ancestors: Collections-ct.982

Fixes comparison of OrderedDictionary. Thanks to Christian Haider for reporting it!

Does it make sense to call super? Or is it better to compare keys before comparing values?

=============== Diff against Collections-ct.982 ===============

Item was added:
+ ----- Method: OrderedDictionary>>= (in category 'comparing') -----
+ = anObject
+ 	"Two ordered dictionaries are equal if
+ 	 (a) they are the same 'kind' of thing.
+ 	 (b) they have the same set of keys in the same order.
+ 	 (c) for each (common) key, they have the same value"
+ 
+ 	self == anObject ifTrue: [ ^true ].
+ 	self species == anObject species ifFalse: [ ^false ].
+ 	self size = anObject size ifFalse: [ ^false ].
+ 	self keys = anObject keys ifFalse: [ ^false].
+ 	self associationsDo: [ :association |
+ 		(anObject at: association key ifAbsent: [ ^false ]) = association value
+ 			ifFalse: [ ^false ] ].
+ 	^true!



More information about the Squeak-dev mailing list