Use splice rather than swaps to pop the undo stack

This commit is contained in:
Thomas Goyne 2014-03-04 11:02:43 -08:00
parent ff21670388
commit 9a347b0b29

View file

@ -308,9 +308,7 @@ void SubsController::OnCommit(AssFileCommit c) {
void SubsController::Undo() {
if (undo_stack.size() <= 1) return;
redo_stack.emplace_back(AssFile(), undo_stack.back().undo_description, commit_id);
context->ass->swap(redo_stack.back().file);
undo_stack.pop_back();
redo_stack.splice(redo_stack.end(), undo_stack, std::prev(undo_stack.end()));
*context->ass = undo_stack.back().file;
commit_id = undo_stack.back().commit_id;