doesn't call `makeIterator()`

(Tim Vermeulen) #1

The implementation of can be found here:

It uses repeated subscripts, rather than `makeIterator()`. Isn’t this a problem? I overloaded `makeIterator` on a custom collection once (I think it was a binary tree) because an iterator would be able to iterate the collection more efficiently than subscripts would (both O(n), but with a lower constant factor). If `makeIterator` isn’t overloaded, then subscripts are used anyways (by `IndexingIterator`). Wouldn’t it make more sense to use an iterator in instead, in order to benefit from a possibly more efficient iterator than the default one?