The Trunk: Kernel-ul.467.mcz

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

The Trunk: Kernel-ul.467.mcz

commits-2
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.467.mcz

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

Name: Kernel-ul.467
Author: ul
Time: 1 July 2010, 9:11:12.989 pm
UUID: fd9601ae-bedf-9342-b329-947d78cb0329
Ancestors: Kernel-eem.466

- a bit faster DependentsArray >> #select: implementation
- added missing MethodDictionary >> #associationAt:ifAbsent:

=============== Diff against Kernel-eem.466 ===============

Item was added:
+ ----- Method: MethodDictionary>>associationAt:ifAbsent: (in category 'accessing') -----
+ associationAt: key ifAbsent: aBlock
+ "Answer the association with the given key.
+ If key is not found, return the result of evaluating aBlock."
+
+ ^(array at: (self scanFor: key))
+ ifNil: [ aBlock value ]
+ ifNotNil: [ :value | key -> value ]!

Item was changed:
  ----- Method: DependentsArray>>select: (in category 'enumerating') -----
  select: aBlock
  "Refer to the comment in Collection|select:."
+ | basicSize newSelf size selection |
- | basicSize newSelf size dep selection |
  basicSize := self basicSize.
  newSelf := self species new: basicSize.
  size := 0.
+ 1 to: basicSize do: [ :i |
+ (self basicAt: i) ifNotNil: [ :dep |
+ (aBlock value: dep) ifTrue: [
+ newSelf basicAt: (size := size+1) put: dep ] ] ].
- 1 to: basicSize do: [:i |
- ((dep := self basicAt: i) notNil and: [aBlock value: dep]) ifTrue: [newSelf basicAt: (size := size+1) put: dep]].
  selection := self species new: size.
  selection basicReplaceFrom: 1 to: size with: newSelf startingAt: 1.
  ^selection!