[Pkg] The Trunk: Collections-ul.362.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jun 15 18:40:21 UTC 2010


Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.362.mcz

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

Name: Collections-ul.362
Author: ul
Time: 12 June 2010, 9:23:26.86 pm
UUID: dabb4c65-e01e-8247-b3a4-6c5db80a2307
Ancestors: Collections-nice.361

- a fix for the bug reported at http://lists.squeakfoundation.org/pipermail/squeak-dev/2010-June/151226.html

=============== Diff against Collections-nice.361 ===============

Item was changed:
  ----- Method: WeakKeyDictionary>>finalizeValues (in category 'finalization') -----
  finalizeValues
  	"Remove and finalize all elements which have nil key"
  	
  	|  cleanUpAfterRemove |
  	tally = 0 ifTrue: [ ^self ].
  	cleanUpAfterRemove := false.
  	1 to: array size do: [ :index |
  		(array at: index) 
  			ifNil: [ cleanUpAfterRemove := false ]
  			ifNotNil: [ :element |
  				element key
  					ifNil: [
  						finalizer ifNotNil: [ finalizer value: element value ].
  						array at: index put: nil.
  						tally := tally - 1.
  						cleanUpAfterRemove := true ]
  					ifNotNil: [ :key |
  						cleanUpAfterRemove ifTrue: [
  							| newIndex |
  							(newIndex := self scanFor: key) = index ifFalse: [
  								array 
  									at: newIndex put: element;
+ 									at: index put: nil ] ] ] ] ].
+ 	cleanUpAfterRemove ifTrue: [ "Continue rehashing at the front of array"
+ 		self fixCollisionsFrom: array size ]
+ 					!
- 									at: index put: nil ] ] ] ] ]!



More information about the Packages mailing list