mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 15:58:17 +00:00
refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)
vim-patch:8.2.0559: clearing a struct is verbose
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
a80faa8930
This commit is contained in:
@@ -793,8 +793,8 @@ static void free_buffer(buf_T *buf)
|
||||
if (autocmd_busy) {
|
||||
// Do not free the buffer structure while autocommands are executing,
|
||||
// it's still needed. Free it when autocmd_busy is reset.
|
||||
memset(&buf->b_namedm[0], 0, sizeof(buf->b_namedm));
|
||||
memset(&buf->b_changelist[0], 0, sizeof(buf->b_changelist));
|
||||
CLEAR_FIELD(buf->b_namedm);
|
||||
CLEAR_FIELD(buf->b_changelist);
|
||||
buf->b_next = au_pending_free_buf;
|
||||
au_pending_free_buf = buf;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user