mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-25 17:10:38 +00:00
comment out the invariants check for zero_padded_buffer, it's too expensive
This commit is contained in:
@@ -20,8 +20,11 @@ impl<const N: usize> Default for Buf<N> {
|
||||
impl<const N: usize> Buf<N> {
|
||||
#[inline(always)]
|
||||
fn invariants(&self) {
|
||||
debug_assert!(self.written <= N, "{}", self.written);
|
||||
debug_assert!(self.allocation[self.written..N].iter().all(|v| *v == 0));
|
||||
// don't check by default, unoptimized is too expensive even for debug mode
|
||||
if false {
|
||||
debug_assert!(self.written <= N, "{}", self.written);
|
||||
debug_assert!(self.allocation[self.written..N].iter().all(|v| *v == 0));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_zero_padded_slice(&self) -> &[u8; N] {
|
||||
|
||||
Reference in New Issue
Block a user