2007-03-29 Stephen Compall * kernel/Dictionary.st: Use a smaller default size in new. * kernel/HashedColl.st: Treat new:'s argument as a requested capacity. --- orig/kernel/Dictionary.st +++ mod/kernel/Dictionary.st @@ -55,7 +55,7 @@ to create dictionaries. Unfortunately, this #new method only creates dictionaries, so subclasses when trying to use this method, lose big. This fixes the problem." - ^self new: 31 + ^self new: 24 ! ! --- orig/kernel/HashedColl.st +++ mod/kernel/HashedColl.st @@ -51,13 +51,13 @@ new "Answer a new instance of the receiver with a default size" - ^self new: 8 + ^self new: 0 ! new: anInteger - "Answer a new instance of the receiver with the given size" + "Answer a new instance of the receiver with the given capacity" | realSize | - realSize := 8 max: anInteger. + realSize := 8 max: (anInteger * 4 + 2) // 3. (realSize bitAnd: (realSize - 1)) = 0 ifFalse: [ realSize := 1 bitShift: realSize highBit ].