OrderedDictionary (was: Re: [squeak-dev] Re: The Trunk:
Collections-mt.593.mcz)
Marcel Taeumel
marcel.taeumel at student.hpi.uni-potsdam.de
Fri Jan 16 16:28:47 UTC 2015
Okay, the Array >> #do: comes down to Number's:
to: stop do: aBlock
"Normally compiled in-line, and therefore not overridable.
Evaluate aBlock for each element of the interval (self to: stop by: 1)."
| nextValue |
nextValue := self.
[nextValue <= stop]
whileTrue:
[aBlock value: nextValue.
nextValue := nextValue + 1]
And the LinkedList >> #do: is:
do: aBlock
| aLink |
aLink := firstLink.
[aLink == nil] whileFalse:
[aBlock value: aLink.
aLink := aLink nextLink]
So Array iteration has the incrementation of 1 in each iteration. That makes
the difference? I thought that #to:do: is optimized as it does not appear on
the stack... :)
Best,
Marcel
--
View this message in context: http://forum.world.st/The-Trunk-Collections-mt-593-mcz-tp4799750p4799947.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.
More information about the Squeak-dev
mailing list
|