remove num_actions

This commit is contained in:
2025-06-02 14:21:37 -05:00
parent 40671daa85
commit 862fff6c2f
2 changed files with 1 additions and 4 deletions

View File

@@ -87,10 +87,8 @@ void cUndoList::add(action_ptr what){
UNDO_LOG("Performing " + what->getActionName()); UNDO_LOG("Performing " + what->getActionName());
theList.erase(theList.begin(), cur); theList.erase(theList.begin(), cur);
theList.push_front(what); theList.push_front(what);
num_actions++; while(theList.size() > maxUndoSize) {
while(num_actions > maxUndoSize) {
theList.pop_back(); theList.pop_back();
num_actions--;
} }
cur = theList.begin(); cur = theList.begin();
} }

View File

@@ -56,7 +56,6 @@ using action_ptr = std::shared_ptr<cAction>;
class cUndoList { class cUndoList {
std::list<action_ptr> theList; std::list<action_ptr> theList;
std::list<action_ptr>::iterator cur, lastSave; std::list<action_ptr>::iterator cur, lastSave;
size_t num_actions = 0;
public: public:
/// Construct a new undo list. /// Construct a new undo list.
cUndoList(); cUndoList();