diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-04-30 20:25:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-04-30 20:25:19 +0200 |
commit | 45cf6e910c6d162775ca9d470fac4b6db844001f (patch) | |
tree | b0bec5c61e2b92d5deba1e71fb4f20216d1596fe /src/eval.c | |
parent | 29ae377ea7039874337bc79ace9ab2b37b9056e5 (diff) | |
download | vim-git-45cf6e910c6d162775ca9d470fac4b6db844001f.tar.gz |
patch 8.0.0593: duplication of code for adding a list or dict return valuev8.0.0593
Problem: Duplication of code for adding a list or dict return value.
Solution: Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c index 1313cefab..401171c9b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -4665,9 +4665,7 @@ eval_index( item = item->li_next; } clear_tv(rettv); - rettv->v_type = VAR_LIST; - rettv->vval.v_list = l; - ++l->lv_refcount; + rettv_list_set(rettv, l); } else { @@ -8486,9 +8484,7 @@ getwinvar( if (opts != NULL) { - rettv->v_type = VAR_DICT; - rettv->vval.v_dict = opts; - ++opts->dv_refcount; + rettv_dict_set(rettv, opts); done = TRUE; } } |