You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fixes memory leak of grouped iterator
* Improved by throwing away unnecessary elements and by cleaning buffer before adding new elements.
* Used Iterator instead of AbstractIterator
* List.take/drop optimizations. See also #1910
* Added Iterator.sliding() benchmark
* Based benchmark Iterators of element array
* Fixed a bug/uncovered case
* low-level optimization
Note: This should have been done already in #1800.
Catalyst:
List.drop(int)
is usually O(n):For finite-sized collections like List we store the size, so we can do better:
In other words, when we drop all elements, we can take a shortcut in O(1).
Possible Optimizations
Note: First check
n <= 0
beforen >= size()
to omit method call if possible.The text was updated successfully, but these errors were encountered: