diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-09-18 13:18:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-18 13:18:45 +0200 |
commit | 19b47b043de2628d7ace4d65aaf124b225ed7351 (patch) | |
tree | 5760c592d1f4abaad8c2d66c84438aa29b0a6e57 | |
parent | dc6cc4787c16d2b339699c12136c400c1b3b5cef (diff) | |
download | rneovim-19b47b043de2628d7ace4d65aaf124b225ed7351.tar.gz rneovim-19b47b043de2628d7ace4d65aaf124b225ed7351.tar.bz2 rneovim-19b47b043de2628d7ace4d65aaf124b225ed7351.zip |
eval.c: Clean up spurious FAIL checks. (#5345)
rettv_list_alloc cannot fail.
-rw-r--r-- | src/nvim/eval.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index ac6de04df6..c762ce9fff 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -9668,12 +9668,11 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) } pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); - if ((rettv_list_alloc(rettv) != FAIL) && (pat != NULL)) { - int i; - + rettv_list_alloc(rettv); + if (pat != NULL) { ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP); - for (i = 0; i < xpc.xp_numfiles; i++) { + for (int i = 0; i < xpc.xp_numfiles; i++) { list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); } } @@ -16771,9 +16770,8 @@ static void f_wildmenumode(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "win_findbuf()" function static void f_win_findbuf(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - if (rettv_list_alloc(rettv) != FAIL) { - win_findbuf(argvars, rettv->vval.v_list); - } + rettv_list_alloc(rettv); + win_findbuf(argvars, rettv->vval.v_list); } /// "win_getid()" function @@ -16791,9 +16789,8 @@ static void f_win_gotoid(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "win_id2tabwin()" function static void f_win_id2tabwin(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - if (rettv_list_alloc(rettv) != FAIL) { - win_id2tabwin(argvars, rettv->vval.v_list); - } + rettv_list_alloc(rettv); + win_id2tabwin(argvars, rettv->vval.v_list); } /// "win_id2win()" function |