patch 9.0.0373: Coverity warns for NULL check and unused return value
Problem: Coverity warns for NULL check and unused return value.
Solution: Remove the NULL check, it was already checked earlier. Add (void)
to ignore the return value.
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 3e0a377..3c4f1a2 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -862,7 +862,7 @@
if (defer_tv->v_type != VAR_LIST)
{
- // first one, allocate the list
+ // first time, allocate the list
if (rettv_list_alloc(defer_tv) == FAIL)
return FAIL;
}
@@ -874,8 +874,7 @@
listval.v_type = VAR_LIST;
listval.vval.v_list = l;
listval.v_lock = 0;
- if (list_insert_tv(defer_l, &listval,
- defer_l == NULL ? NULL : defer_l->lv_first) == FAIL)
+ if (list_insert_tv(defer_l, &listval, defer_l->lv_first) == FAIL)
{
vim_free(l);
return FAIL;