Closed rbarbey closed 8 years ago
:+1:
That's an iterator over a lazily computed set of nodes. See the implementation of Iter.Next. If you want to know the full length, you'll need to iterate over it and pay the price. I wouldn't like to hide that complexity over a Length() method, and we definitely cannot have it as a field.
These changes should generally be accompanied by a good set of tests. That'd also show you the actual problem with the current approach.