summaryrefslogtreecommitdiff
path: root/src/if_perl.xs
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-30 20:25:19 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-30 20:25:19 +0200
commit45cf6e910c6d162775ca9d470fac4b6db844001f (patch)
treeb0bec5c61e2b92d5deba1e71fb4f20216d1596fe /src/if_perl.xs
parent29ae377ea7039874337bc79ace9ab2b37b9056e5 (diff)
downloadvim-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.xs8
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 */