mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 12:50:32 +01:00
Slightly more efficiently pre-allocate bitsets
This commit is contained in:
@@ -113,7 +113,7 @@ impl BitSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_capacity(capacity: usize) -> Self {
|
pub fn with_capacity(capacity: usize) -> Self {
|
||||||
let buffer = Vec::with_capacity(capacity / 32);
|
let buffer = vec![0; capacity / 32];
|
||||||
|
|
||||||
Self { buffer }
|
Self { buffer }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user