Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searchsortedbefore - reverse of searchsortedafter #879

Open
devinallen opened this issue Nov 2, 2023 · 2 comments · May be fixed by #880
Open

searchsortedbefore - reverse of searchsortedafter #879

devinallen opened this issue Nov 2, 2023 · 2 comments · May be fixed by #880

Comments

@devinallen
Copy link

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?

@StephenVavasis
Copy link
Contributor

Seems like a good idea to me. If you submit a PR, I can review it.

@devinallen devinallen linked a pull request Nov 9, 2023 that will close this issue
@devinallen
Copy link
Author

Sorry for the delay, PR made :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants