[squeak-dev] A beautiful idiom.
Stéphane Rollandin
lecteur at zogotounga.net
Wed Feb 12 00:09:25 UTC 2020
This one is faster though (it uses the fact that the elements are
already ordered):
| nc |
nc := self species new: self size.
self ifEmpty: [^ nc].
nc add: self first.
self do: [:ea | nc last = ea ifFalse: [nc add: ea]].
^ nc
Stef
More information about the Squeak-dev
mailing list
|