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

Use msbIdx for direct lookup, and then additional check if prev is la… #32168

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

baldersheim
Copy link
Contributor

…rge enough.

@vekterli or @jonmv PR
This supeceeds #31993

jonmv
jonmv previously approved these changes Aug 19, 2024
@baldersheim baldersheim merged commit cad7770 into master Aug 19, 2024
3 checks passed
@baldersheim baldersheim deleted the balder/use-msbIdx-for-direct-lookup branch August 19, 2024 10:45
size_t prime = hashtable_base::getModuloStl(num);
EXPECT_GREATER_EQUAL(prime, num);
EXPECT_EQUAL(prime, hashtable_base::getModuloStl(prime));
EXPECT_GREATER(hashtable_base::getModuloStl(prime+1), prime + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This can only work because 0 < 7 (for i = 31), but ok 😁

Copy link
Member

@vekterli vekterli left a comment

Choose a reason for hiding this comment

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

👍 just to verify, I ran a brute force check between the old and new code for all values in [0, UINT32_MAX] and the outputs were identical for the same input size

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.

3 participants