Skip to content

Collection implementations don't override spliterator() #115

@techsy730

Description

@techsy730

The various Collection (and Collections of Map (keySet(), etc)) implementations don't appear to override spliterator(). This means they will inherit the quite inefficient generic default implementations from List, Set, etc. This makes using stream() operations potentially quite inefficient.
Many of the types can abuse the internals of the collection to work much faster.

I get that the stream() (currently the only real user of Spliterators) on anything other then Object, int, long, and double Collections are going to involve either a boxing or a casting (due to only those 3 primitives being "recognized" by java.util.stream, and Object being Object), but for these four cases it would be nice to have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions