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
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions crates/store/re_log_types/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ impl Hash128 {
Self(double_hash(value))
}

#[inline]
pub fn hash64(&self) -> u64 {
self.0[0]
}

#[inline]
pub fn first64(&self) -> u64 {
self.0[0]
Expand All @@ -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

}
}

Expand Down
Loading