eclipse / eclipse-collections

Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.
https://eclipse.dev/collections/
2.43k stars 610 forks source link

Optimize ImmutableArrayList.takeWhile() and dropWhile() for small lists. #1640

Closed motlin closed 2 months ago

motlin commented 3 months ago

ImmutableArrayList.takeWhile() and dropWhile() always return ImmutableArrayList. Since these methods don't delegate to a factory, they can't return ImmutableEmptyList for example.

prithviraj2609 commented 2 months ago

Hello @motlin,

I have tried resolving this issue and created a PR for the same. Would you review and merge my PR if this issue is still open Here is my PR: https://github.com/eclipse/eclipse-collections/pull/1644