Skip to content

Commit

Permalink
Added bits field to stage
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall committed Sep 10, 2024
1 parent d111247 commit 8e220e4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/enc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ use std::fmt;

/// An encoding stage used for vlue compression.
pub struct Stage {
prefix_bits: u8,
bits: u8,
prefix: u8,
prefix_bits: u8,
ordinal_bits: u8,
ordinal_low: i64,
}
Expand All @@ -17,8 +18,9 @@ impl Stage {
assert!(ordinal_bits < 64);

Stage {
prefix_bits,
bits: prefix_bits + ordinal_bits,
prefix,
prefix_bits,
ordinal_bits,
ordinal_low,
}
Expand Down Expand Up @@ -57,7 +59,7 @@ impl Stage {
/// Returns the total number of bits used to encode a value.
#[inline]
pub const fn bits(&self) -> u8 {
self.prefix_bits() + self.ordinal_bits()
self.bits
}
}

Expand Down

0 comments on commit 8e220e4

Please sign in to comment.