From 9e664318af7c33bcc6dd72612294d1d7c982a271 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Dec 2015 22:18:25 +0000 Subject: [PATCH] Tweak Context::push_jump implementation, simplify code --- src/context.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/context.cc b/src/context.cc index 48a502e1..d2113a55 100644 --- a/src/context.cc +++ b/src/context.cc @@ -87,12 +87,7 @@ void Context::push_jump() { const SelectionList& jump = selections(); if (m_current_jump != m_jump_list.end()) - { - auto begin = m_current_jump; - if (&buffer() != &begin->buffer() or *begin != jump) - ++begin; - m_jump_list.erase(begin, m_jump_list.end()); - } + m_jump_list.erase(m_current_jump+1, m_jump_list.end()); m_jump_list.erase(std::remove(begin(m_jump_list), end(m_jump_list), jump), end(m_jump_list)); m_jump_list.push_back(jump);