Mercurial > vim
diff src/map.c @ 29175:755ab148288b v8.2.5107
patch 8.2.5107: some callers of rettv_list_alloc() check for not OK
Commit: https://github.com/vim/vim/commit/93a1096fe48e12095544924adb267e3b8a16b221
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 16 11:42:09 2022 +0100
patch 8.2.5107: some callers of rettv_list_alloc() check for not OK
Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van
Willegen)
Solution: Use "==" instead of "!=" when checking the return value.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 16 Jun 2022 12:45:03 +0200 |
parents | 1ec1ba7e7728 |
children | 35a30cb18005 |
line wrap: on
line diff
--- a/src/map.c +++ b/src/map.c @@ -2379,7 +2379,7 @@ get_maparg(typval_T *argvars, typval_T * } } - else if (rettv_dict_alloc(rettv) != FAIL && rhs != NULL) + else if (rettv_dict_alloc(rettv) == OK && rhs != NULL) mapblock2dict(mp, rettv->vval.v_dict, did_simplify ? keys_simplified : NULL, buffer_local, abbr); @@ -2409,7 +2409,7 @@ f_maplist(typval_T *argvars UNUSED, typv if (argvars[0].v_type != VAR_UNKNOWN) abbr = tv_get_bool(&argvars[0]); - if (rettv_list_alloc(rettv) != OK) + if (rettv_list_alloc(rettv) == FAIL) return; validate_maphash();