Skip to content

Commit cc1dc6c

Browse files
authored
Restore accidentally removed method Block::to_ne_bytes (#8211)
This method was removed in #7824, which introduced an optimized code path for writing bloom filters on little-endian architectures. The method was however still used in the big-endian code-path. Due to the use of `#[cfg(target_endian)]` this went unnoticed in CI. Fixes #8207
1 parent 26c9c7a commit cc1dc6c

File tree

1 file changed

+7
-0
lines changed
  • parquet/src/bloom_filter

1 file changed

+7
-0
lines changed

parquet/src/bloom_filter/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ impl Block {
119119
Self(result)
120120
}
121121

122+
#[inline]
123+
#[cfg(not(target_endian = "little"))]
124+
fn to_ne_bytes(self) -> [u8; 32] {
125+
// SAFETY: [u32; 8] and [u8; 32] have the same size and neither has invalid bit patterns.
126+
unsafe { std::mem::transmute(self.0) }
127+
}
128+
122129
#[inline]
123130
#[cfg(not(target_endian = "little"))]
124131
fn to_le_bytes(self) -> [u8; 32] {

0 commit comments

Comments
 (0)