The Trunk: Kernel-ul.1176.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.1176.mcz

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

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

Name: Kernel-ul.1176
Author: ul
Time: 4 June 2018, 7:28:14.840591 pm
UUID: 70ad3394-d256-4a05-91aa-b5b2937739e3
Ancestors: Kernel-ul.1175

- iterative version of Context >> #copyTo: instead of a recursive one
- optimized version of Integer >> #timesRepeat:

=============== Diff against Kernel-ul.1175 ===============

Item was changed:
  ----- Method: Context>>copyTo: (in category 'query') -----
  copyTo: aContext
+ "Copy self and my sender chain down to, but not including, aContext. End of copied chain will have nil sender. Assume that there is no loop in the context chain."
- "Copy self and my sender chain down to, but not including, aContext.  End of copied chain will have nil sender."
 
+ | currentContext senderContext copy |
- | copy |
  self == aContext ifTrue: [ ^nil ].
+ currentContext := copy := self copy.
+ [
+ senderContext := (currentContext sender ifNil: [ ^copy ]) copy.
+ currentContext privSender: senderContext.
+ currentContext := senderContext ] repeat!
- copy := self copy.
- sender ifNotNil: [ copy privSender: (sender copyTo: aContext) ].
- ^copy!

Item was changed:
  ----- Method: Integer>>timesRepeat: (in category 'enumerating') -----
  timesRepeat: aBlock
  "Evaluate the argument, aBlock, the number of times represented by the
  receiver."
 
+ | remaining |
+ remaining := self.
+ [ (remaining := remaining - 1) >= 0 ] whileTrue: [
+ aBlock value ]!
- | count |
- count := 1.
- [count <= self]
- whileTrue:
- [aBlock value.
- count := count + 1]!