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

Error in compare #32

Open
aleph-v opened this issue Aug 19, 2018 · 0 comments
Open

Error in compare #32

aleph-v opened this issue Aug 19, 2018 · 0 comments

Comments

@aleph-v
Copy link

aleph-v commented Aug 19, 2018

This line should be "if(shortest - idx < 32){" otherwise we don't mask out the bits of the shortest string which aren't part of the string. Eg if we have two slices one with 33 bytes and one with 34 bytes the algorithm will compare the first 32 bytes then move on to the next 32 bytes, but shortest variable will be 33 so the current code will not mask out the last 31 bytes of this next chunk of memory.

if(shortest < 32) {

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

No branches or pull requests

1 participant