Skip to content

Conversation

@froydnj
Copy link
Collaborator

@froydnj froydnj commented Jan 18, 2026

We don't hit this code very often, but we might as well try to be fast when we do.

This way performs a little bit more work than necessary -- there is probably a smarter way to do this based on binary searching for the start and then the end of the range, and then deciding based on those results, but this way is more elegant.

@froydnj
Copy link
Collaborator Author

froydnj commented Jan 18, 2026

Realized this morning that this is not quite right -- contains doesn't partition the slice in the way partition_point requires. The partitioning is FTF instead of FT. So we'll have to do the real binary search thing, which I'll write up later today.

@fables-tales
Copy link
Owner

I have a concern that we're moving from a data structure that is inherently correct for this problem to one where we have to be careful about how we use it. Are we sure it's actually worth it here?

@froydnj froydnj force-pushed the froydnj-has-comments-partitioning branch 2 times, most recently from 7fc0ddf to 39c92a7 Compare January 18, 2026 15:34
@froydnj froydnj force-pushed the froydnj-has-comments-partitioning branch from 39c92a7 to 6d551a9 Compare January 18, 2026 15:35
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 this pull request may close these issues.

4 participants