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

Remove unnecessary buffer #1

Merged
merged 1 commit into from
May 3, 2024
Merged

Remove unnecessary buffer #1

merged 1 commit into from
May 3, 2024

Conversation

Sytten
Copy link
Contributor

@Sytten Sytten commented May 3, 2024

I managed to removed the partial buffer with a better matching algorithm.
I don't think I missed edge cases. Essentially it remembers the match position of the needle in-between loop runs so it restarts from that position in the needle.

@programingjd programingjd merged commit 096c66c into programingjd:main May 3, 2024
@programingjd
Copy link
Owner

I spent some time to make sure that all the corner cases were covered also. At first I wasn't sure that match_len would be reset correctly if there was no match, but it is.
I've updated the comment, renamed the test, and merged the changes.
Thank you very much for your contribution.

@programingjd
Copy link
Owner

I've pushed the update to crates.io with version 0.1.3

@Sytten
Copy link
Contributor Author

Sytten commented May 3, 2024

Thanks! I will try to push into native tokio, but it's likely to be rejected so its good we have it here

@Sytten
Copy link
Contributor Author

Sytten commented May 3, 2024

Linked PR tokio-rs/tokio#6531, we will see if it gets accepted

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