The Inbox: Collections-ul.877.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Collections-ul.877.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.877.mcz

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

Name: Collections-ul.877
Author: ul
Time: 27 February 2020, 2:00:22.678898 pm
UUID: df2c680a-81dd-49bf-a1c2-a0fec288ce0f
Ancestors: Collections-mt.876

- recalculate tally in WeakIdentityDictionary >> #noCheckNoGrowFillFrom: to prevent it becoming greater than the maximum number of elements the dictionary can hold

=============== Diff against Collections-mt.876 ===============

Item was changed:
  ----- Method: WeakIdentityDictionary>>noCheckNoGrowFillFrom: (in category 'private') -----
  noCheckNoGrowFillFrom: anArray
  "Add the elements of anArray except nils to me assuming that I don't contain any of them, they are unique and I have more free space than they require."
 
+ tally := 0.
  1 to: anArray size do: [ :index |
  (anArray at: index) ifNotNil: [ :association |
+ association == vacuum ifFalse: [
+ array
- association == vacuum
- ifFalse: [array
  at: (self scanForEmptySlotFor: association key)
+ put: association.
+ tally := tally + 1 ] ] ]!
- put: association ] ] ]!