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

commits at source.squeak.org commits at source.squeak.org
Sun Oct 17 02:00:40 UTC 2010


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

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

Name: Collections-ul.390
Author: ul
Time: 17 October 2010, 3:38:56.423 am
UUID: 1638a00b-ac3f-ee49-9ea9-60dd8dea28ed
Ancestors: Collections-ul.389

- faster OrderedCollection >> #removeAllSuchThat: (for some cases)
- use blocks instead of symbols

=============== Diff against Collections-ul.389 ===============

Item was changed:
  ----- Method: HashedCollection class>>compactAllInstances (in category 'initialize-release') -----
  compactAllInstances
+ 	"Do not use #allInstancesDo: because #compact may create new instances."
- 	"Do not use #allInstancesDo: because compact may create new instances."
  
+ 	self allInstances do: [ :each | each compact ]!
- 	self allInstances do: #compact!

Item was changed:
  ----- Method: HashedCollection class>>rehashAllInstances (in category 'initialize-release') -----
  rehashAllInstances
+ 	"Do not use #allInstancesDo: because #rehash may create new instances."
- 	"Do not use #allInstancesDo: because rehash may create new instances."
  
+ 	self allInstances do: [ :each | each rehash ]!
- 	self allInstances do: #rehash!

Item was changed:
  ----- Method: OrderedCollection>>removeAllSuchThat: (in category 'removing') -----
  removeAllSuchThat: aBlock 
  	"Remove each element of the receiver for which aBlock evaluates to true.
  	The method in Collection is O(N^2), this is O(N)."
  
  	| n |
  	n := firstIndex.
  	firstIndex to: lastIndex do: [:index |
  	    (aBlock value: (array at: index)) ifFalse: [
  			array at: n put: (array at: index).
  			n := n + 1]].
+ 	array from: n to: lastIndex put: nil.
- 	n to: lastIndex do: [:index | array at: index put: nil].
  	lastIndex := n - 1!



More information about the Packages mailing list