[ENH] SortedCollection fast removal ( [er] needs additional work )

renggli at student.unibe.ch renggli at student.unibe.ch
Fri Mar 5 12:40:36 UTC 2004


> This change set adds fast methods for inclusion test and
> element removal to the instance protocol of SortedCollection.

This is true, most methods of SortedCollection don't take advantage of
the fact that the  collection is sorted. Adding methods such as the
proposed ones need to make clear that SortedCollection can be only used
with sort-blocks that don't have sideeffects and that are deterministic.

> The new methods have their own names, they do not 
> override inherited methods.

- Why introduce new names like #fastIndexOf and #fastRemove:ifAbsent:?
In my opinion a method name should not reveal its implementation
strategy in its name. I would suggest to override the existing methods
#indexOf: and #remove:ifAbsent:.

- There is duplicated code in #indexForInserting:,
#fastIndexOf:startingAt:ifAbsent: and #fastRemove:ifAbsent:

Cheers,
Lukas

-- 
Lukas Renggli
http://renggli.freezope.org



More information about the Squeak-dev mailing list