[squeak-dev] The Inbox: Collections-ul.136.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 17 04:23:56 UTC 2009


A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-ul.136.mcz

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

Name: Collections-ul.136
Author: ul
Time: 17 September 2009, 6:23:30 am
UUID: 4673316d-d3a8-844b-9efc-482078ed4109
Ancestors: Collections-ul.135

- primitive 60 won't help with Array >> #at:ifAbsent: because it accepts only one parameter, so changed SequenceableCollection >> #at:ifAbsent: to get some improvement (assumes that indexes greater than the upper bound are more common than indexes smaller than the lower bound)

=============== Diff against Collections-ul.135 ===============

Item was changed:
  ----- Method: SequenceableCollection>>at:ifAbsent: (in category 'accessing') -----
  at: index ifAbsent: exceptionBlock 
  	"Answer the element at my position index. If I do not contain an element 
  	at index, answer the result of evaluating the argument, exceptionBlock."
  
+ 	(index <= self size  and: [ 1 <= index ]) ifTrue: [ ^self at: index ].
+ 	^exceptionBlock value!
- 	(index between: 1 and: self size) ifTrue: [^ self at: index].
- 	^ exceptionBlock value!

Item was removed:
- ----- Method: Array>>at:ifAbsent: (in category 'accessing') -----
- at: index ifAbsent: exceptionBlock
- 	"Optimized to go through the primitive if possible"
- 	
- 	<primitive: 60>
- 	(index between: 1 and: self size) ifTrue: [ ^self at: index ].
- 	^exceptionBlock value!




More information about the Squeak-dev mailing list