diff options
author | Christian Brabandt <cb@256bit.org> | 2024-02-15 20:17:37 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-02-15 20:17:37 +0100 |
commit | 9071ed8107244e0c56a16b77d1c28e975cb21dd2 (patch) | |
tree | 81dbf77196eba6af7b99de1785d7e2b5b4dfda68 /src/fileio.c | |
parent | f0d3d4a42657dca996e790aa829de3c6be7fdb63 (diff) |
patch 9.1.0113: duplicate code when cleaning undo stackv9.1.0113
Problem: duplicate code when cleaning undo stack
Solution: refactor undo cleanup into a single public function
related: #13928
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c index 180fe3906c..d293d713d3 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4514,10 +4514,7 @@ buf_reload(buf_T *buf, int orig_mode, int reload_options) // Mark the buffer as unmodified and free undo info. unchanged(buf, TRUE, TRUE); if ((flags & READ_KEEP_UNDO) == 0) - { - u_blockfree(buf); - u_clearall(buf); - } + u_clearallandblockfree(buf); else { // Mark all undo states as changed. |