From ff1041a8b7bf65a2120575b649fb05cdab8ced36 Mon Sep 17 00:00:00 2001 From: Joe Hellerstein Date: Fri, 25 Oct 2024 15:43:18 -0700 Subject: [PATCH] remove stale commented-out code --- lattices/src/ght.rs | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/lattices/src/ght.rs b/lattices/src/ght.rs index 40c148b9ef3c..1918aa63185b 100644 --- a/lattices/src/ght.rs +++ b/lattices/src/ght.rs @@ -84,7 +84,6 @@ where Node: GeneralizedHashTrieNode, { pub(crate) children: HashMap, - // pub(crate) _leaf: std::marker::PhantomData, } impl Default for GhtInner @@ -94,10 +93,7 @@ where { fn default() -> Self { let children = Default::default(); - Self { - children, - // _leaf: Default::default(), - } + Self { children } } } @@ -205,7 +201,8 @@ where { pub(crate) elements: Storage, pub(crate) forced: bool, - pub(crate) _suffix_schema: PhantomData, /* defines ValType for the parents, recursively */ + /// defines ValType for the parents, recursively + pub(crate) _suffix_schema: PhantomData, } impl Default for GhtLeaf where @@ -267,7 +264,6 @@ where fn contains<'a>(&'a self, row: ::AsRefVar<'a>) -> bool { self.elements.iter().any(|r| Schema::eq_ref(r, row)) - //.any(|r| Schema::eq_ref(r.as_ref_var(), row)) } fn recursive_iter(&self) -> impl Iterator::AsRefVar<'_>> { @@ -280,10 +276,11 @@ where ) -> Option<&'_ GhtLeaf<::Schema, Self::ValType, Self::Storage>> { // TODO(mingwei): actually use the hash set as a hash set - if self.elements.iter().any(|x| { - // let (_prefix, suffix) = Schema::split_by_suffix_ref(x.as_ref_var()); - ::eq_ref(row, x) //.as_ref_var()) - }) { + if self + .elements + .iter() + .any(|x| ::eq_ref(row, x)) + { Some(self) } else { None @@ -301,18 +298,8 @@ where impl GeneralizedHashTrieNode for GhtLeaf where - Schema: 'static - + Eq - + VariadicExt - + Hash - + Clone - // + SplitBySuffix - + PartialEqVariadic, + Schema: 'static + Eq + VariadicExt + Hash + Clone + PartialEqVariadic, Storage: VariadicCollection + Default + IntoIterator, - // ValHead: Clone + Eq + Hash, - // var_type!(ValHead, ...ValRest): Clone + Eq + Hash + PartialEqVariadic, - // >::Prefix: Eq + Hash + Clone, - // for<'a> Schema::AsRefVar<'a>: PartialEq, { type Schema = Schema; type SuffixSchema = (); // var_type!(ValHead, ...ValRest); @@ -344,7 +331,6 @@ where fn contains<'a>(&'a self, row: ::AsRefVar<'a>) -> bool { self.elements.iter().any(|r| Schema::eq_ref(r, row)) - // .any(|r| Schema::eq_ref(r.as_ref_var(), row)) } fn recursive_iter(&self) -> impl Iterator::AsRefVar<'_>> { @@ -358,7 +344,6 @@ where { // TODO(mingwei): actually use the hash set as a hash set if self.elements.iter().any(|x| { - // let (_prefix, suffix) = Schema::split_by_suffix_ref(x.as_ref_var()); ::eq_ref(row, x) //.as_ref_var()) }) { Some(self) @@ -432,8 +417,6 @@ where self.children.get_mut(head) } - // /// The type of items returned by iter - // type IterKey = Self::Head; fn iter(&self) -> impl Iterator { self.children.keys().cloned() } @@ -465,15 +448,12 @@ where None } - // /// The type of items returned by iter - // type IterKey = Self::Schema; fn iter(&self) -> impl Iterator { std::iter::empty() } fn iter_tuples(&self) -> impl Iterator::AsRefVar<'_>> { - // impl Iterator { - self.elements.iter() //.cloned() + self.elements.iter() } } @@ -536,7 +516,6 @@ where KeyPrefixRef: 'static + RefVariadic, Schema: 'static + VariadicExt + Hash + Eq + SplitBySuffix, ValType: VariadicExt, - // for<'a> SuffixSchema::AsRefVar<'a>: Split, ValType: Split, KeyPrefixRef::UnRefVar: PartialEqVariadic, Storage: 'static + VariadicCollection,