File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -610,23 +610,15 @@ ::count_unmarked_nodes(
610
610
611
611
unsigned count = 0 ;
612
612
613
- // depth, node pointer
614
- typedef std::pair<unsigned , const baset *> stack_itemt;
615
-
616
- std::stack<stack_itemt> stack;
617
- stack.push ({0 , &map});
613
+ std::stack<const innert *> stack;
614
+ stack.push (&map);
618
615
619
616
do
620
617
{
621
- const stack_itemt &si = stack.top ();
622
-
623
- const unsigned depth = si.first ;
624
- const baset *bp = si.second ;
625
-
618
+ const innert *ip = stack.top ();
626
619
stack.pop ();
627
620
628
621
// internal node or container node
629
- const innert *ip = static_cast <const innert *>(bp);
630
622
const unsigned use_count = ip->use_count ();
631
623
const void *raw_ptr = ip->is_internal ()
632
624
? (const void *)&ip->read_internal ()
@@ -650,20 +642,22 @@ ::count_unmarked_nodes(
650
642
count++;
651
643
}
652
644
653
- if (depth < steps) // internal
645
+ if (ip-> is_internal ())
654
646
{
647
+ SM_ASSERT (!ip->empty ());
648
+
655
649
const to_mapt &m = ip->get_to_map ();
656
650
SM_ASSERT (!m.empty ());
657
651
658
652
for (const auto &item : m)
659
653
{
660
654
const innert *i = &item.second ;
661
- stack.push ({depth + 1 , i} );
655
+ stack.push (i );
662
656
}
663
657
}
664
- else // container
658
+ else
665
659
{
666
- SM_ASSERT (depth == steps );
660
+ SM_ASSERT (ip-> is_defined_container () );
667
661
668
662
const leaf_listt &ll = ip->get_container ();
669
663
SM_ASSERT (!ll.empty ());
You can’t perform that action at this time.
0 commit comments