hollow
hollow copied to clipboard
HollowList iterator calls size() on every hasNext
HollowList doesn't implement it's own iterator, instead delegating to java.util.AbstractList.Itr and java.util.AbstractList.ListItr. However Itr calls size() on every call to hasNext():
public boolean hasNext() {
return cursor != size();
}
That said, size is also required for checking if a collection is empty, and is called forlast() in Kotlin so maybe keeping size after first access for the list delegate is a better approach?
Can this be worked?