mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Use splice rather than swaps to pop the undo stack
This commit is contained in:
parent
ff21670388
commit
9a347b0b29
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user