More cleanup.

This commit is contained in:
2018-09-13 16:33:17 +02:00
parent cbccf03da5
commit 1da5bab61e

View File

@@ -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,
} }
} }