diff -r 4e09b7829b51 -r f40dfaf2166d src/bisection_tree/bt.rs --- a/src/bisection_tree/bt.rs Tue Nov 01 09:24:45 2022 +0200 +++ b/src/bisection_tree/bt.rs Fri Nov 18 10:29:50 2022 +0200 @@ -109,7 +109,7 @@ fn lower_or(&self) -> Self::Lower; /// Returns the numeric value of the depth - fn value(&self) -> usize; + fn value(&self) -> u32; } /// Dynamic (runtime) [`Depth`] for a [`BT`]. @@ -136,8 +136,8 @@ } #[inline] - fn value(&self) -> usize { - self.0 as usize + fn value(&self) -> u32 { + self.0 as u32 } } @@ -145,7 +145,7 @@ type Lower = Self; fn lower(&self) -> Option { None } fn lower_or(&self) -> Self::Lower { Const } - fn value(&self) -> usize { 0 } + fn value(&self) -> u32 { 0 } } macro_rules! impl_constdepth { @@ -154,7 +154,7 @@ type Lower = Const<{$n-1}>; fn lower(&self) -> Option { Some(Const) } fn lower_or(&self) -> Self::Lower { Const } - fn value(&self) -> usize { $n } + fn value(&self) -> u32 { $n } } )* }; } @@ -474,9 +474,9 @@ NodeOption::Branches(b) => { // FIXME: recursion that may cause stack overflow if the tree becomes // very deep, e.g. due to [`BTSearch::search_and_refine`]. - Arc::make_mut(b).insert(domain, d, new_leaf_depth.lower_or(), support, - task_budget); - b.summarise_into(&mut self.aggregator) + let bm = Arc::make_mut(b); + bm.insert(domain, d, new_leaf_depth.lower_or(), support, task_budget); + bm.summarise_into(&mut self.aggregator); }, } } @@ -517,11 +517,11 @@ NodeOption::Branches(b) => { // FIXME: recursion that may cause stack overflow if the tree becomes // very deep, e.g. due to [`BTSearch::search_and_refine`]. - let bnew = Arc::new(Arc::unwrap_or_clone(b).convert_aggregator(generator, domain)); + let bnew = Arc::unwrap_or_clone(b).convert_aggregator(generator, domain); let mut anew = ANew::new(); bnew.summarise_into(&mut anew); Node { - data : NodeOption::Branches(bnew), + data : NodeOption::Branches(Arc::new(bnew)), aggregator : anew, } } @@ -551,8 +551,9 @@ NodeOption::Branches(ref mut b) => { // FIXME: recursion that may cause stack overflow if the tree becomes // very deep, e.g. due to [`BTSearch::search_and_refine`]. - Arc::make_mut(b).refresh_aggregator(generator, domain, task_budget); - b.summarise_into(&mut self.aggregator); + let bm = Arc::make_mut(b); + bm.refresh_aggregator(generator, domain, task_budget); + bm.summarise_into(&mut self.aggregator); } } }