Skip to content

Commit

Permalink
Use FxHashMap: src/cdb/binary.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
shnarazk committed Dec 13, 2024
1 parent f29093f commit df09ded
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ rust-version = "1.80"

[dependencies]
bitflags = "^2.6"

instant = { version = "0.1", features = ["wasm-bindgen"], optional = true }

crossterm = { version = "^0.27", optional = true }
ratatui = { version = "^0.28", features = ["all-widgets"], optional = true }
rustc_data_structures = "^0.1"
Expand Down
6 changes: 4 additions & 2 deletions src/cdb/binary.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use {
crate::types::*,
rustc_data_structures::fx::{FxHashMap, FxHasher},
std::{
collections::hash_map::HashMap,
hash::BuildHasherDefault,
ops::{Index, IndexMut},
slice::Iter,
},
Expand All @@ -26,14 +28,14 @@ impl IndexMut<Lit> for Vec<BinaryLinkList> {
/// storage with mapper to `ClauseIndex` of binary links
#[derive(Clone, Debug, Default)]
pub struct BinaryLinkDB {
pub(super) hash: HashMap<Lit, BinaryLinkList>,
pub(super) hash: FxHashMap<Lit, BinaryLinkList>,
empty: BinaryLinkList,
}

impl Instantiate for BinaryLinkDB {
fn instantiate(_conf: &Config, _cnf: &CNFDescription) -> Self {
BinaryLinkDB {
hash: HashMap::new(),
hash: HashMap::<Lit, BinaryLinkList, BuildHasherDefault<FxHasher>>::default(),
empty: BinaryLinkList::default(),
}
}
Expand Down

0 comments on commit df09ded

Please sign in to comment.