(
array: &T,
random_state: &RandomState,
hashes_buffer: &mut [u64],
rehash: bool,
)
| 260 | /// with the new hash using `combine_hashes` |
| 261 | #[cfg(not(feature = "force_hash_collisions"))] |
| 262 | fn hash_array<T>( |
| 263 | array: &T, |
| 264 | random_state: &RandomState, |
| 265 | hashes_buffer: &mut [u64], |
| 266 | rehash: bool, |
| 267 | ) where |
| 268 | T: ArrayAccessor, |
| 269 | T::Item: HashValue, |
| 270 | { |
| 271 | assert_eq!( |
| 272 | hashes_buffer.len(), |
| 273 | array.len(), |
| 274 | "hashes_buffer and array should be of equal length" |
| 275 | ); |
| 276 | |
| 277 | if array.null_count() == 0 { |
| 278 | if rehash { |
| 279 | for (i, hash) in hashes_buffer.iter_mut().enumerate() { |
| 280 | let value = unsafe { array.value_unchecked(i) }; |
| 281 | *hash = combine_hashes(value.hash_one(random_state), *hash); |
| 282 | } |
| 283 | } else { |
| 284 | for (i, hash) in hashes_buffer.iter_mut().enumerate() { |
| 285 | let value = unsafe { array.value_unchecked(i) }; |
| 286 | *hash = value.hash_one(random_state); |
| 287 | } |
| 288 | } |
| 289 | } else if rehash { |
| 290 | for i in array.nulls().unwrap().valid_indices() { |
| 291 | let value = unsafe { array.value_unchecked(i) }; |
| 292 | hashes_buffer[i] = |
| 293 | combine_hashes(value.hash_one(random_state), hashes_buffer[i]); |
| 294 | } |
| 295 | } else { |
| 296 | for i in array.nulls().unwrap().valid_indices() { |
| 297 | let value = unsafe { array.value_unchecked(i) }; |
| 298 | hashes_buffer[i] = value.hash_one(random_state); |
| 299 | } |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | /// Hash a StringView or BytesView array |
| 304 | /// |
nothing calls this directly
no test coverage detected
searching dependent graphs…