*: Provide list length when allocating lists

This commit is contained in:
ZyX
2018-01-03 00:00:16 +03:00
parent 9ddeb6e187
commit 9ea1752d60
19 changed files with 223 additions and 202 deletions

View File

@@ -714,7 +714,7 @@ static dict_T *menu_get_recursive(const vimmenu_T *menu, int modes)
}
} else {
// visit recursively all children
list_T *children_list = tv_list_alloc();
list_T *const children_list = tv_list_alloc(kListLenMayKnow);
for (menu = menu->children; menu != NULL; menu = menu->next) {
dict_T *dic = menu_get_recursive(menu, modes);
if (tv_dict_len(dict) > 0) {