MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / clear

Method clear

src/common/classes/stack.h:621–656  ·  view source on GitHub ↗

clear stacks until mark

Source from the content-addressed store, hash-verified

619
620 // clear stacks until mark
621 void clear (const iterator& mark)
622 {
623 // for empty mark just clear all stack
624 if (!mark.stk)
625 {
626 clear();
627 return;
628 }
629
630 // find entry to clear
631 while (stk != mark.stk)
632 {
633 if (!stk)
634 {
635 return;
636 }
637 Entry *tmp = stk->next;
638 stk->next = 0;
639 delete stk;
640 stk = tmp;
641 }
642
643 // remove extra elements from Entry
644 fb_assert(stk->getCount() >= mark.elem);
645 if (mark.elem == 0)
646 {
647 Entry *tmp = stk->next;
648 stk->next = 0;
649 delete stk;
650 stk = tmp;
651 }
652 else
653 {
654 stk->shrink(mark.elem);
655 }
656 }
657
658 FB_SIZE_T getCount() const throw()
659 {

Callers

nothing calls this directly

Calls 3

clearClass · 0.50
getCountMethod · 0.45
shrinkMethod · 0.45

Tested by

no test coverage detected