Skip to content

Commit

Permalink
Use wrapping operations in fsst_hash (#31)
Browse files Browse the repository at this point in the history
Use explicitly wrapping operations in `fsst_hash` so it'll run nicely in
all tests.
  • Loading branch information
AdamGS authored Sep 12, 2024
1 parent 4b1ec32 commit 08505ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ fn make_sample<'a, 'b: 'a>(sample_buf: &'a mut Vec<u8>, str_in: &Vec<&'b [u8]>)
/// This is equivalent to the FSST_HASH macro from the C++ implementation.
#[inline]
pub(crate) fn fsst_hash(value: u64) -> u64 {
(value * 2971215073) ^ (value >> 15)
value.wrapping_mul(2971215073) ^ value.wrapping_shr(15)
}

impl Compressor {
Expand Down

0 comments on commit 08505ab

Please sign in to comment.