mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +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:
@@ -59,7 +59,7 @@ static LuaTableProps nlua_traverse_table(lua_State *const lstate)
|
||||
size_t other_keys_num = 0; // Number of keys that are not string, integral
|
||||
// or type keys.
|
||||
LuaTableProps ret;
|
||||
memset(&ret, 0, sizeof(ret));
|
||||
CLEAR_FIELD(ret);
|
||||
if (!lua_checkstack(lstate, lua_gettop(lstate) + 3)) {
|
||||
semsg(_("E1502: Lua failed to grow stack to %i"), lua_gettop(lstate) + 2);
|
||||
ret.type = kObjectTypeNil;
|
||||
|
Reference in New Issue
Block a user