From 252f87592625245d1a90c6063bb3882790b51a6b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 29 Jan 2013 19:05:40 +0100 Subject: [PATCH] fix sort_and_merge_overlapping --- src/editor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.cc b/src/editor.cc index 6ed0b8a2..0a19d5a8 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -136,7 +136,7 @@ static void sort_and_merge_overlapping(SelectionList& selections) [&](const Selection& sel) { return sel.begin() <= back.begin(); }); std::stable_sort(selections.begin(), selections.end(), compare_selections); - if (back_rank < selections.size() - 1) + if (back_rank < selections.size()) std::rotate(selections.begin(), selections.begin() + back_rank, selections.end()); assert(selections.back() == back);