[squeak-dev] The Trunk: Collections-mt.595.mcz
Tobias Pape
Das.Linux at gmx.de
Fri Jan 16 15:00:30 UTC 2015
Hi,
On 16.01.2015, at 08:09, commits at source.squeak.org wrote:
> The index is updated in O(1) [time] when inserting new keys. For present keys, that insertion involves actions in O(n) to move the respective element to the end of the order.
Why?
I would expect, that first insert wins:
(OrderedDictionary new
at: 'foo' put: 100;
at: 'bar' put: 20;
at: 'foo' put: 59;
yourself)
keysAndValuesDo: [:key :value |
Transcript show: key asString, ' > ', value asString; cr.
]
"Should print:
foo > 59
bar > 20
"
Don't you think?
Best
-Tobias
More information about the Squeak-dev
mailing list
|