comparison src/insexpand.c @ 20392:4c317d8c1051 v8.2.0751

patch 8.2.0751: Vim9: performance can be improved Commit: https://github.com/vim/vim/commit/7e9f351b2e69b498c4ee5004d7459844e1ba191a Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 13 22:44:22 2020 +0200 patch 8.2.0751: Vim9: performance can be improved Problem: Vim9: performance can be improved. Solution: Don't call break. Inline check for list materialize. Make an inline version of ga_grow().
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 May 2020 22:45:04 +0200
parents 06a1dd50463e
children 9064044fd4f6
comparison
equal deleted inserted replaced
20391:9ceee4daa596 20392:4c317d8c1051
2332 { 2332 {
2333 listitem_T *li; 2333 listitem_T *li;
2334 int dir = compl_direction; 2334 int dir = compl_direction;
2335 2335
2336 // Go through the List with matches and add each of them. 2336 // Go through the List with matches and add each of them.
2337 range_list_materialize(list); 2337 CHECK_LIST_MATERIALIZE(list);
2338 FOR_ALL_LIST_ITEMS(list, li) 2338 FOR_ALL_LIST_ITEMS(list, li)
2339 { 2339 {
2340 if (ins_compl_add_tv(&li->li_tv, dir) == OK) 2340 if (ins_compl_add_tv(&li->li_tv, dir) == OK)
2341 // if dir was BACKWARD then honor it just once 2341 // if dir was BACKWARD then honor it just once
2342 dir = FORWARD; 2342 dir = FORWARD;
2517 if (what_list == NULL) 2517 if (what_list == NULL)
2518 what_flag = CI_WHAT_ALL; 2518 what_flag = CI_WHAT_ALL;
2519 else 2519 else
2520 { 2520 {
2521 what_flag = 0; 2521 what_flag = 0;
2522 range_list_materialize(what_list); 2522 CHECK_LIST_MATERIALIZE(what_list);
2523 FOR_ALL_LIST_ITEMS(what_list, item) 2523 FOR_ALL_LIST_ITEMS(what_list, item)
2524 { 2524 {
2525 char_u *what = tv_get_string(&item->li_tv); 2525 char_u *what = tv_get_string(&item->li_tv);
2526 2526
2527 if (STRCMP(what, "mode") == 0) 2527 if (STRCMP(what, "mode") == 0)