making an editor for something and trying to figure out how to implement undo/redo, in the past I would just save the file to memory after every change and store it in a stack, but this editor the files are gonna be tens of megabytes in size
-
-
(Bonus: save the hash lists, and you get backups for free).
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
the main issue is just that "saving the file" is relatively expensive here, and can't be threaded (or rather I really really dont want to deal with threading here), less so the storage (cause like even a 10mb file would "only" use up 2.5 gigs of ram for an undo stack size of 256)
-
also its not that hard to ensure that my "commands" here are reversible, the actual code for executing the commands is pretty small (the entire file for that is ~70 lines of code currently). though that might not be the case if it was a more complicated thing
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.