From 862fff6c2f1faeb5ab5b084edeeb7b2662ea12ad Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 2 Jun 2025 14:21:37 -0500 Subject: [PATCH] remove num_actions --- src/tools/undo.cpp | 4 +--- src/tools/undo.hpp | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/undo.cpp b/src/tools/undo.cpp index 792f706e..12771e2b 100644 --- a/src/tools/undo.cpp +++ b/src/tools/undo.cpp @@ -87,10 +87,8 @@ void cUndoList::add(action_ptr what){ UNDO_LOG("Performing " + what->getActionName()); theList.erase(theList.begin(), cur); theList.push_front(what); - num_actions++; - while(num_actions > maxUndoSize) { + while(theList.size() > maxUndoSize) { theList.pop_back(); - num_actions--; } cur = theList.begin(); } diff --git a/src/tools/undo.hpp b/src/tools/undo.hpp index 84958699..f0bbae44 100644 --- a/src/tools/undo.hpp +++ b/src/tools/undo.hpp @@ -56,7 +56,6 @@ using action_ptr = std::shared_ptr; class cUndoList { std::list theList; std::list::iterator cur, lastSave; - size_t num_actions = 0; public: /// Construct a new undo list. cUndoList();