neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 582e0714b5fc43f541c4d80513c9aba3535b5e10
parent 6a330f893bf15ecab99f1fc796029c7bdba71139
Author: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Date:   Sun, 31 Aug 2025 01:29:43 -0400

vim-patch:8.1.1752: resizing hashtable is inefficient (#35563)

Problem:    Resizing hashtable is inefficient.
Solution:   Avoid resizing when the final size is predictable.

https://github.com/vim/vim/commit/7b73d7ebf71c9148c90a500116f25ec2314c7273

Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat:
Msrc/nvim/hashtab.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c @@ -317,7 +317,7 @@ static void hash_may_resize(hashtab_T *ht, size_t minitems) // Use specified size. minitems = MAX(minitems, ht->ht_used); // array is up to 2/3 full - minsize = minitems * 3 / 2; + minsize = (minitems * 3 + 1) / 2; } size_t newsize = HT_INIT_SIZE;