From 129c951f7a7349ba7cb737d604e622f7659e11cf Mon Sep 17 00:00:00 2001 From: Alexander Beedie Date: Mon, 20 May 2024 10:45:43 +0400 Subject: [PATCH] fix: Address overflow combining u64 hashes in Debug builds (#16323) --- crates/polars-core/src/series/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/polars-core/src/series/mod.rs b/crates/polars-core/src/series/mod.rs index a1be063e65dd..ce9c1914a46f 100644 --- a/crates/polars-core/src/series/mod.rs +++ b/crates/polars-core/src/series/mod.rs @@ -147,7 +147,7 @@ impl Hash for Wrap { let rs = RandomState::with_seeds(0, 0, 0, 0); let mut h = vec![]; self.0.vec_hash(rs, &mut h).unwrap(); - let h = UInt64Chunked::from_vec("", h).sum(); + let h = h.into_iter().fold(0, |a: u64, b| a.wrapping_add(b)); h.hash(state) } }