Skip to content

Commit 7d1aba1

Browse files
committed
rlw field is actually an offset into bits when used at runtime (#293)
It's u32 when stored though.
1 parent 9e99e01 commit 7d1aba1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git-bitmap/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ pub mod ewah {
5050
}
5151

5252
let (rlw, data) = decode::u32(data).ok_or(decode::Error::Corrupt("eof while reading run length width"))?;
53+
dbg!(rlw);
5354

5455
Ok((
5556
Vec {
5657
num_bits,
5758
bits: buf,
58-
rlw,
59+
rlw: rlw as usize,
5960
},
6061
data,
6162
))
@@ -66,6 +67,7 @@ pub mod ewah {
6667
pub struct Vec {
6768
num_bits: u32,
6869
bits: std::vec::Vec<u64>,
69-
rlw: u32,
70+
/// RLW is an offset into the `bits` buffer, so `1` translates into &bits[1] essentially.
71+
rlw: usize,
7072
}
7173
}

0 commit comments

Comments
 (0)