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/if_perl.xs | |
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/if_perl.xs')
-rw-r--r-- | src/if_perl.xs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/if_perl.xs b/src/if_perl.xs index 076c5c601..2bf72c534 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -1136,9 +1136,7 @@ perl_to_vim(SV *sv, typval_T *rettv) } } - list->lv_refcount++; - rettv->v_type = VAR_LIST; - rettv->vval.v_list = list; + rettv_list_set(rettv, list); break; } case SVt_PVHV: /* dictionary */ @@ -1192,9 +1190,7 @@ perl_to_vim(SV *sv, typval_T *rettv) } } - dict->dv_refcount++; - rettv->v_type = VAR_DICT; - rettv->vval.v_dict = dict; + rettv_dict_set(rettv, dict); break; } default: /* not convertible */ |