mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0593: duplication of code for adding a list or dict return value
Problem: Duplication of code for adding a list or dict return value. Solution: Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan)
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user