From 3f0507fc319d750af88fcd309b78f622391b9cc9 Mon Sep 17 00:00:00 2001 From: oflatt Date: Tue, 15 Oct 2024 09:40:10 -0700 Subject: [PATCH] Revert "nondeterministic feature" This reverts commit 894407c7ff185fd2a9ef268e2ae4d6987bf71e4b. --- Cargo.toml | 1 - src/gj.rs | 15 ++++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 22ef1a2a9..339acd895 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ default = ["bin"] bin = ["dep:clap", "dep:env_logger", "egraph-serialize/serde", "dep:serde_json"] wasm-bindgen = ["instant/wasm-bindgen", "dep:getrandom"] -nondeterministic = [] [dependencies] hashbrown = { version = "0.14", features = ["raw"] } diff --git a/src/gj.rs b/src/gj.rs index 940ec0375..ce00dae0c 100644 --- a/src/gj.rs +++ b/src/gj.rs @@ -792,14 +792,7 @@ impl Debug for LazyTrie { } } -#[cfg(feature = "nondeterministic")] -type SparseMap = HashMap; -#[cfg(feature = "nondeterministic")] -type SEntry<'a, A, B, D> = hashbrown::hash_map::Entry<'a, A, B, D>; -#[cfg(not(feature = "nondeterministic"))] type SparseMap = IndexMap; -#[cfg(not(feature = "nondeterministic"))] -type SEntry<'a, A, B> = Entry<'a, A, B>; type RowIdx = u32; #[derive(Debug)] @@ -895,8 +888,8 @@ impl LazyTrie { LazyTrieInner::Borrowed { index, map } => { let ixs = index.get(&value)?; match map.entry(value) { - SEntry::Occupied(o) => Some(o.into_mut()), - SEntry::Vacant(v) => { + Entry::Occupied(o) => Some(o.into_mut()), + Entry::Vacant(v) => { Some(v.insert(LazyTrie::from_indexes(access.filter_live(ixs))?)) } } @@ -948,14 +941,14 @@ impl<'a> TrieAccess<'a> { && self.constraints.iter().all(|c| c.check(tup, out)) { match map.entry(val) { - SEntry::Occupied(mut e) => { + indexmap::map::Entry::Occupied(mut e) => { if let LazyTrieInner::Delayed(ref mut v) = e.get_mut().0.get_mut() { v.push(i as RowIdx) } else { unreachable!() } } - SEntry::Vacant(e) => { + indexmap::map::Entry::Vacant(e) => { e.insert(LazyTrie(UnsafeCell::new(LazyTrieInner::Delayed( smallvec::smallvec![i as RowIdx,], ))));