More cleanup.
This commit is contained in:
@@ -19,9 +19,6 @@ use hasher::BitBuildHasher;
|
|||||||
|
|
||||||
const BITS: u64 = 64;
|
const BITS: u64 = 64;
|
||||||
|
|
||||||
type Block = u64;
|
|
||||||
type Storage = HashMap<u64, Block, BitBuildHasher>;
|
|
||||||
|
|
||||||
pub type BitHashMap<V> = HashMap<u64, V, BitBuildHasher>;
|
pub type BitHashMap<V> = HashMap<u64, V, BitBuildHasher>;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
@@ -31,7 +28,7 @@ fn block_bit(x: u64, d: u64) -> (u64, u64) {
|
|||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone)]
|
#[derive(PartialEq, Eq, Clone)]
|
||||||
pub struct BitSet {
|
pub struct BitSet {
|
||||||
blocks: Storage,
|
blocks: HashMap<u64, u64, BitBuildHasher>,
|
||||||
nbits: usize,
|
nbits: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +36,7 @@ impl BitSet {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub fn new() -> BitSet {
|
pub fn new() -> BitSet {
|
||||||
BitSet {
|
BitSet {
|
||||||
blocks: Storage::default(),
|
blocks: HashMap::default(),
|
||||||
nbits: 0,
|
nbits: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,7 +44,7 @@ impl BitSet {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub fn with_capacity(capacity: usize) -> BitSet {
|
pub fn with_capacity(capacity: usize) -> BitSet {
|
||||||
BitSet {
|
BitSet {
|
||||||
blocks: Storage::with_capacity_and_hasher(capacity / BITS as usize, Default::default()),
|
blocks: HashMap::with_capacity_and_hasher(capacity / BITS as usize, Default::default()),
|
||||||
nbits: 0,
|
nbits: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user