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:
Leonardo de Moura 2015-12-06 15:45:55 -08:00
parent 4cd4b6236d
commit b7c96722c7

View file

@ -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) {