1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

use the smallest possible size int for descriminant reading/writing

This commit is contained in:
Robin Appelman 2021-07-24 17:34:29 +02:00
commit eb4bafc310
4 changed files with 40 additions and 18 deletions

View file

@ -142,7 +142,7 @@ where
});
}
if type_bit_size < USIZE_BITS {
if type_bit_size < USIZE_BITS || count < USIZE_BITS {
self.push_bits(value.into_usize_unchecked(), count);
} else {
self.push_non_fit_bits(value.into_bytes(), count)