mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
*: Remove most calls to tv_list_item_alloc
Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the only reason why function did not receive `static` modifier.
This commit is contained in:
@@ -787,16 +787,14 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
|
||||
|
||||
for (uint32_t i = 0; i < obj.data.array.size; i++) {
|
||||
Object item = obj.data.array.items[i];
|
||||
listitem_T *li = tv_list_item_alloc();
|
||||
typval_T li_tv;
|
||||
|
||||
if (!object_to_vim(item, TV_LIST_ITEM_TV(li), err)) {
|
||||
// cleanup
|
||||
tv_list_item_free(li);
|
||||
if (!object_to_vim(item, &li_tv, err)) {
|
||||
tv_list_free(list);
|
||||
return false;
|
||||
}
|
||||
|
||||
tv_list_append(list, li);
|
||||
tv_list_append_owned_tv(list, li_tv);
|
||||
}
|
||||
tv_list_ref(list);
|
||||
|
||||
|
Reference in New Issue
Block a user