diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-16 14:27:41 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-16 14:27:41 +0300 |
commit | 7f3b9a4acc503709c89a501aaee304ff208bd995 (patch) | |
tree | 73e2d477fc8664ccaffad9dbc000132c7fa82857 /src/nvim/eval/typval.c | |
parent | 76ffe0c5aa51fe4fe14811e86867af2c711190a1 (diff) | |
parent | 7afd26a6d189d1ca798f93db8661bd656a37265f (diff) | |
download | rneovim-7f3b9a4acc503709c89a501aaee304ff208bd995.tar.gz rneovim-7f3b9a4acc503709c89a501aaee304ff208bd995.tar.bz2 rneovim-7f3b9a4acc503709c89a501aaee304ff208bd995.zip |
Merge branch 'master' into hide-container-impl
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r-- | src/nvim/eval/typval.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 5040695b09..53c56d0ffd 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1880,14 +1880,20 @@ static inline void _nothing_conv_func_end(typval_T *const tv, const int copyID) tv->v_lock = VAR_UNLOCKED; \ } while (0) +static inline void _nothing_conv_empty_dict(typval_T *const tv, + dict_T **const dictp) + FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_NONNULL_ARG(2) +{ + tv_dict_unref(*dictp); + *dictp = NULL; + if (tv != NULL) { + tv->v_lock = VAR_UNLOCKED; + } +} #define TYPVAL_ENCODE_CONV_EMPTY_DICT(tv, dict) \ do { \ assert((void *)&dict != (void *)&TYPVAL_ENCODE_NODICT_VAR); \ - tv_dict_unref((dict_T *)dict); \ - *((dict_T **)&dict) = NULL; \ - if (tv != NULL) { \ - ((typval_T *)tv)->v_lock = VAR_UNLOCKED; \ - } \ + _nothing_conv_empty_dict(tv, ((dict_T **)&dict)); \ } while (0) static inline int _nothing_conv_real_list_after_start( |