From d6a2d7785762be28563bb6424a00198c9f39c8b5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 4 Nov 2015 19:53:47 +0000 Subject: [PATCH] Fix double check_invariant in SelectionList construction, and set main selection to last --- src/selection.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/selection.cc b/src/selection.cc index b2432d6e..80828b93 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -22,23 +22,18 @@ SelectionList::SelectionList(Buffer& buffer, Selection s, size_t timestamp) } SelectionList::SelectionList(Buffer& buffer, Selection s) - : SelectionList(buffer, std::move(s), buffer.timestamp()) -{ - check_invariant(); -} + : SelectionList(buffer, std::move(s), buffer.timestamp()) {} SelectionList::SelectionList(Buffer& buffer, Vector s, size_t timestamp) : m_buffer(&buffer), m_selections(std::move(s)), m_timestamp(timestamp) { kak_assert(size() > 0); + m_main = size() - 1; check_invariant(); } SelectionList::SelectionList(Buffer& buffer, Vector s) - : SelectionList(buffer, std::move(s), buffer.timestamp()) -{ - check_invariant(); -} + : SelectionList(buffer, std::move(s), buffer.timestamp()) {} namespace {