Fix debug condition of ValueBuffer

Off-by-one, this was meant to check a minimum length that includes
equality but instead tested a valid index.
This commit is contained in:
A. Molzer committed 2026-01-13 15:37:22 +01:00
1 parent 1d138a5568
commit 87341f9075
1 file changed
+2 -2
+2 -2
View File
@@ -390,7 +390,7 @@ impl ValueBuffer {
debug_assert!({
self.ty
.value_bytes(self.count)
.is_ok_and(|n| n < self.bytes.len() as u64)
.is_ok_and(|n| n <= self.bytes.len() as u64)
});
self.count
@@ -439,7 +439,7 @@ impl ValueBuffer {
pub(crate) fn assume_type(&mut self, ty: Type, count: u64, bo: ByteOrder) {
debug_assert!({
ty.value_bytes(count)
.is_ok_and(|n| n < self.bytes.len() as u64)
.is_ok_and(|n| n <= self.bytes.len() as u64)
});
self.byte_order = bo;