Skip to content

Collection.indexOf() problems with isSorted == true #2629

Closed
@alexandersoto

Description

@alexandersoto

Using indexOf() with isSorted set to true on a collection with a 2 argument comparator does not work as I would expect.

Ultimately, I think the issue lies with _.sortedIndex() not being designed for a 2 argument comparator. Related - I don't think Collection.sortedIndex() works if the collection has a 2 argument comparator. I think that's the root of the problem.

Other thought:
I think it would be great if isSorted defaulted to true if a collection defined a comparator.

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