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

Bytes::split_to - check fast path first #689

Merged
merged 1 commit into from Apr 10, 2024

Conversation

braddunbar
Copy link
Contributor

If at == self.len() then we already know at <= self.len(). If at == 0, it can't be greater than self.len().

If `at == self.len()` then we already know `at <= self.len()`. If
`at == 0`, it can't be greater than `self.len()`.
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit 4eb62b9 into tokio-rs:master Apr 10, 2024
15 checks passed
@braddunbar braddunbar deleted the split-to-fast-paths branch April 10, 2024 10:34
braddunbar added a commit to braddunbar/bytes that referenced this pull request Apr 13, 2024
Follow up to tokio-rs#689

* If `at == self.len()`, we already know `at <= self.len()`.
* If `at == 0`, we already know `at <= self.len()`.
braddunbar added a commit that referenced this pull request Apr 24, 2024
Follow up to #689

* If `at == self.len()`, we already know `at <= self.len()`.
* If `at == 0`, we already know `at <= self.len()`.
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.

None yet

2 participants