File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed
Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -578,23 +578,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
578578 /// Gets the number of [TapLeaf](`TapTree::Leaf`)s considering exhaustive root-level [`Policy::Or`]
579579 /// and [`Policy::Thresh`] disjunctions for the `TapTree`.
580580 #[ cfg( feature = "compiler" ) ]
581- fn num_tap_leaves ( & self ) -> usize {
582- use Policy :: * ;
583-
584- let mut nums = vec ! [ ] ;
585- for data in self . rtl_post_order_iter ( ) {
586- let num = match data. node {
587- Or ( subs) => ( 0 ..subs. len ( ) ) . map ( |_| nums. pop ( ) . unwrap ( ) ) . sum ( ) ,
588- Thresh ( thresh) if thresh. is_or ( ) => {
589- ( 0 ..thresh. n ( ) ) . map ( |_| nums. pop ( ) . unwrap ( ) ) . sum ( )
590- }
591- _ => 1 ,
592- } ;
593- nums. push ( num) ;
594- }
595- // Ok to unwrap because we know we processed at least one node.
596- nums. pop ( ) . unwrap ( )
597- }
581+ fn num_tap_leaves ( & self ) -> usize { self . tapleaf_probability_iter ( ) . count ( ) }
598582
599583 /// Does checks on the number of `TapLeaf`s.
600584 #[ cfg( feature = "compiler" ) ]
You can’t perform that action at this time.
0 commit comments