aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mapping.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-11 15:44:55 +0800
committerGitHub <noreply@github.com>2022-08-11 15:44:55 +0800
commit94c317647845b92d675548a481f664a6a1808426 (patch)
tree5d14079cbf334b1148fbc6927793bc1df72934c5 /src/nvim/mapping.c
parent252dea5927906208ab60f68d70891a82ab9ddd18 (diff)
downloadrneovim-94c317647845b92d675548a481f664a6a1808426.tar.gz
rneovim-94c317647845b92d675548a481f664a6a1808426.tar.bz2
rneovim-94c317647845b92d675548a481f664a6a1808426.zip
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(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r--src/nvim/mapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 342b1b0d47..f0a82b6bec 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -333,7 +333,7 @@ static int str_to_mapargs(const char_u *strargs, bool is_unmap, MapArguments *ma
{
const char_u *to_parse = strargs;
to_parse = (char_u *)skipwhite((char *)to_parse);
- memset(mapargs, 0, sizeof(*mapargs));
+ CLEAR_POINTER(mapargs);
// Accept <buffer>, <nowait>, <silent>, <expr>, <script>, and <unique> in
// any order.