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 dead code: Hash128 #8203

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Remove dead code: Hash128 #8203

merged 3 commits into from
Nov 25, 2024

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Nov 22, 2024

Hash128 isn't actually used anywhere, I just randomly stumbled upon it while refactoring some hashing related stuff.

Still a good idea to fix it (or remove it entirely?) before someone's get bitten.

@teh-cmc teh-cmc added 🪳 bug Something isn't working exclude from changelog PRs with this won't show up in CHANGELOG.md labels Nov 22, 2024
Copy link

github-actions bot commented Nov 22, 2024

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link
6930cfb https://rerun.io/viewer/pr/8203

Note: This comment is updated whenever you push a commit.

@@ -91,7 +86,7 @@ impl Hash128 {
impl std::hash::Hash for Hash128 {
#[inline]
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
state.write_u64(self.0[0]);
state.write_u128((self.first64() as u128) << 64 | self.second64() as u128);
Copy link
Member

Choose a reason for hiding this comment

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

IIRC, you're only allowed to use write_u64 with nohash_hasher, anything else will result in a runtime error in debug builds.

If the hash128 is good, than any 64 bits of it should also be a good hash

@emilk
Copy link
Member

emilk commented Nov 22, 2024

If Hash128 is unused, remove it - but I don' think this PR makes sense

@teh-cmc
Copy link
Member Author

teh-cmc commented Nov 22, 2024

Let's remove it then.

@teh-cmc teh-cmc requested a review from emilk November 22, 2024 15:27
@emilk emilk changed the title Fix some Hash128 shenaniganeries Remove dead code: Hash128 Nov 25, 2024
@emilk emilk added 🚜 refactor Change the code, not the functionality and removed 🪳 bug Something isn't working labels Nov 25, 2024
@emilk emilk merged commit de225e0 into main Nov 25, 2024
38 checks passed
@emilk emilk deleted the cmc/hash128_shenaniganeries branch November 25, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants