Mercurial > vim
comparison src/popupmenu.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 | 43ae8e2fd4c4 |
children | d571231175b4 |
comparison
equal
deleted
inserted
replaced
20391:9ceee4daa596 | 20392:4c317d8c1051 |
---|---|
1316 | 1316 |
1317 balloon_arraysize = list->lv_len; | 1317 balloon_arraysize = list->lv_len; |
1318 balloon_array = ALLOC_CLEAR_MULT(pumitem_T, list->lv_len); | 1318 balloon_array = ALLOC_CLEAR_MULT(pumitem_T, list->lv_len); |
1319 if (balloon_array == NULL) | 1319 if (balloon_array == NULL) |
1320 return; | 1320 return; |
1321 range_list_materialize(list); | 1321 CHECK_LIST_MATERIALIZE(list); |
1322 for (idx = 0, li = list->lv_first; li != NULL; li = li->li_next, ++idx) | 1322 for (idx = 0, li = list->lv_first; li != NULL; li = li->li_next, ++idx) |
1323 { | 1323 { |
1324 char_u *text = tv_get_string_chk(&li->li_tv); | 1324 char_u *text = tv_get_string_chk(&li->li_tv); |
1325 | 1325 |
1326 balloon_array[idx].pum_text = vim_strsave( | 1326 balloon_array[idx].pum_text = vim_strsave( |