From 3404366b6593bbf372da35ef8c7ce6cde429cef7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 23 Jan 2013 14:25:48 +0100 Subject: add more asserts --- src/dynamic_selection_list.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dynamic_selection_list.cc') diff --git a/src/dynamic_selection_list.cc b/src/dynamic_selection_list.cc index d7eb5beb..90067505 100644 --- a/src/dynamic_selection_list.cc +++ b/src/dynamic_selection_list.cc @@ -64,7 +64,10 @@ DynamicSelectionList& DynamicSelectionList::operator=(SelectionList selections) void DynamicSelectionList::check_invariant() const { for (auto& sel : *this) + { assert(m_buffer == &sel.buffer()); + sel.check_invariant(); + } } void DynamicSelectionList::on_insert(const BufferIterator& begin, const BufferIterator& end) @@ -73,7 +76,6 @@ void DynamicSelectionList::on_insert(const BufferIterator& begin, const BufferIt { sel.first().on_insert(begin.coord(), end.coord()); sel.last().on_insert(begin.coord(), end.coord()); - sel.check_invariant(); } } @@ -83,7 +85,6 @@ void DynamicSelectionList::on_erase(const BufferIterator& begin, const BufferIte { sel.first().on_erase(begin.coord(), end.coord()); sel.last().on_erase(begin.coord(), end.coord()); - sel.check_invariant(); } } -- cgit v1.2.3