6 ms·
This is the standard way to implement Undo in editors. You have operations that are put onto stack and applied one after another on the original data. You can c
by ajuc 4y ago
This is the standard way to implement Undo in editors. You have operations that are put onto stack and applied one after another on the original data. You can cache intermediate results for optimization. And when you undo - you just pop the last operation from the stack.