Skip to content

Commit 7b4df74

Browse files
committed
Skip offsets instead of copying and dropping them
1 parent add2002 commit 7b4df74

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/bitmap/ops_with_serialized.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ impl RoaringBitmap {
9292
let mut description_bytes = &description_bytes[..];
9393

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

10099
let mut containers = Vec::new();
@@ -175,10 +174,10 @@ impl RoaringBitmap {
175174
};
176175

177176
if let Some(container) = container {
178-
let mut tmp_container = Container { key, store };
179-
tmp_container &= container;
180-
if !tmp_container.is_empty() {
181-
containers.push(tmp_container);
177+
let mut other_container = Container { key, store };
178+
other_container &= container;
179+
if !other_container.is_empty() {
180+
containers.push(other_container);
182181
}
183182
}
184183
}

0 commit comments

Comments
 (0)