Skip to content

searchsortedbefore - reverse of searchsortedafter #879

Open
@devinallen

Description

@devinallen

For sorted containers, it'd be nice if there was a function analogous to searchsortedafter that instead got the token of the last item that is < a given key. In more detail, searchsortedfirst (first item >= key) is to searchsortedafter (first item > key) as searchsortedlast (last item <= key) would be to... searchsortedbefore? That'd probably be an appropriate name.
I'm willing to write a PR if there's interest in this. Seems like it'd be very simple considering prevloc0 is available in the internals. Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions