From b2ce153aecebe6e1f0907d4552198f2e9f7e76aa Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Thu, 12 Sep 2024 14:55:43 +0100 Subject: [PATCH] use wrapping fns --- src/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index c849884..d801dd5 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -589,7 +589,7 @@ fn make_sample<'a, 'b: 'a>(sample_buf: &'a mut Vec, 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 {