perf(util/rb_tree): mark check_invariant as a conditional/tagged assertion
This assertion is proportional to the tree size. So, it is too expensive to check when we import many declarations.
This commit is contained in:
parent
4cd4b6236d
commit
b7c96722c7
1 changed files with 3 additions and 3 deletions
|
@ -328,18 +328,18 @@ public:
|
|||
|
||||
void insert(T const & v) {
|
||||
m_root = set_black(insert(m_root.steal(), v));
|
||||
lean_assert(check_invariant());
|
||||
lean_cond_assert("rb_tree", check_invariant());
|
||||
}
|
||||
|
||||
void erase_min() {
|
||||
m_root = set_black(erase_min(m_root.steal()));
|
||||
lean_assert(check_invariant());
|
||||
lean_cond_assert("rb_tree", check_invariant());
|
||||
}
|
||||
|
||||
void erase_core(T const & v) {
|
||||
lean_assert(contains(v));
|
||||
m_root = set_black(erase(m_root.steal(), v));
|
||||
lean_assert(check_invariant());
|
||||
lean_cond_assert("rb_tree", check_invariant());
|
||||
}
|
||||
|
||||
void erase(T const & v) {
|
||||
|
|
Loading…
Reference in a new issue