Skip to content

Commit

Permalink
Skip offsets instead of copying and dropping them
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Jun 6, 2024
1 parent add2002 commit 7b4df74
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/bitmap/ops_with_serialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ impl RoaringBitmap {
let mut description_bytes = &description_bytes[..];

if has_offsets {
let mut offsets = vec![0u8; size * OFFSET_BYTES];
reader.read_exact(&mut offsets)?;
drop(offsets); // We could use these offsets but we are lazy
// We could use these offsets but we are lazy
reader.seek(SeekFrom::Current((size * OFFSET_BYTES) as i64))?;
}

let mut containers = Vec::new();
Expand Down Expand Up @@ -175,10 +174,10 @@ impl RoaringBitmap {
};

if let Some(container) = container {
let mut tmp_container = Container { key, store };
tmp_container &= container;
if !tmp_container.is_empty() {
containers.push(tmp_container);
let mut other_container = Container { key, store };
other_container &= container;
if !other_container.is_empty() {
containers.push(other_container);
}
}
}
Expand Down

0 comments on commit 7b4df74

Please sign in to comment.