#BUGFIX by stefan
class: SmallDictionary
added:
#grow:
#isFixedSize
#speciesForCollecting
removed: #growTo:
changed: #growKeysAndValues (send #grow: instead of #growTo:)
--- a/SmallDictionary.st Tue Sep 18 15:29:41 2018 +0200
+++ b/SmallDictionary.st Tue Sep 18 15:40:24 2018 +0200
@@ -209,22 +209,22 @@
!SmallDictionary methodsFor:'private'!
-growKeysAndValues
- "duplicate the capacity"
-
- self growTo:tally * 2
-
- "Modified (comment): / 14-09-2018 / 16:04:17 / Stefan Vogel"
-!
-
-growTo:capacity
+grow:capacity
|newKeysAndValues|
newKeysAndValues := Array new:capacity*2.
newKeysAndValues replaceFrom:1 to:tally * 2 with:keysAndValues.
keysAndValues := newKeysAndValues.
- "Modified (format): / 14-09-2018 / 16:10:49 / Stefan Vogel"
+ "Created: / 18-09-2018 / 15:37:24 / Stefan Vogel"
+!
+
+growKeysAndValues
+ "duplicate the capacity"
+
+ self grow:tally * 2
+
+ "Modified: / 18-09-2018 / 15:37:34 / Stefan Vogel"
!
privateAt:key put:value
@@ -241,6 +241,14 @@
"Modified: / 18-09-2018 / 13:33:30 / Stefan Vogel"
! !
+!SmallDictionary methodsFor:'queries'!
+
+speciesForCollecting
+ ^ Bag
+
+ "Created: / 18-09-2018 / 15:34:27 / Stefan Vogel"
+! !
+
!SmallDictionary methodsFor:'removing'!
empty
@@ -305,6 +313,15 @@
^ tally == 0
"Created: / 14-09-2018 / 15:44:49 / Stefan Vogel"
+!
+
+isFixedSize
+ "return true if the receiver cannot grow - this will vanish once
+ Arrays and Strings learn how to grow ..."
+
+ ^ false
+
+ "Created: / 18-09-2018 / 15:35:25 / Stefan Vogel"
! !
!SmallDictionary class methodsFor:'documentation'!