Use regular Vec in BitSet.
This commit is contained in:
@@ -8,7 +8,6 @@ use std::{fmt, iter, slice};
|
||||
use Chunk::*;
|
||||
#[cfg(feature = "nightly")]
|
||||
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
|
||||
use smallvec::{SmallVec, smallvec};
|
||||
|
||||
use crate::{Idx, IndexVec};
|
||||
|
||||
@@ -118,7 +117,7 @@ macro_rules! bit_relations_inherent_impls {
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
pub struct DenseBitSet<T> {
|
||||
domain_size: usize,
|
||||
words: SmallVec<[Word; 2]>,
|
||||
words: Vec<Word>,
|
||||
marker: PhantomData<T>,
|
||||
}
|
||||
|
||||
@@ -134,7 +133,7 @@ impl<T: Idx> DenseBitSet<T> {
|
||||
#[inline]
|
||||
pub fn new_empty(domain_size: usize) -> DenseBitSet<T> {
|
||||
let num_words = num_words(domain_size);
|
||||
DenseBitSet { domain_size, words: smallvec![0; num_words], marker: PhantomData }
|
||||
DenseBitSet { domain_size, words: vec![0; num_words], marker: PhantomData }
|
||||
}
|
||||
|
||||
/// Creates a new, filled bitset with a given `domain_size`.
|
||||
@@ -142,7 +141,7 @@ impl<T: Idx> DenseBitSet<T> {
|
||||
pub fn new_filled(domain_size: usize) -> DenseBitSet<T> {
|
||||
let num_words = num_words(domain_size);
|
||||
let mut result =
|
||||
DenseBitSet { domain_size, words: smallvec![!0; num_words], marker: PhantomData };
|
||||
DenseBitSet { domain_size, words: vec![!0; num_words], marker: PhantomData };
|
||||
result.clear_excess_bits();
|
||||
result
|
||||
}
|
||||
@@ -1442,7 +1441,7 @@ impl<T: Idx> From<DenseBitSet<T>> for GrowableBitSet<T> {
|
||||
pub struct BitMatrix<R: Idx, C: Idx> {
|
||||
num_rows: usize,
|
||||
num_columns: usize,
|
||||
words: SmallVec<[Word; 2]>,
|
||||
words: Vec<Word>,
|
||||
marker: PhantomData<(R, C)>,
|
||||
}
|
||||
|
||||
@@ -1455,7 +1454,7 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
|
||||
BitMatrix {
|
||||
num_rows,
|
||||
num_columns,
|
||||
words: smallvec![0; num_rows * words_per_row],
|
||||
words: vec![0; num_rows * words_per_row],
|
||||
marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user