aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-27 18:54:52 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-27 18:56:20 +0800
commit9bab4b72ae4c996751a83badc1c2a183c7cbf5d2 (patch)
treeb9f1ee9c7454dc7bc64412d6bacb3c6c5f84ade8
parent59012a18e190532f673e72899b3e005e9792d8f8 (diff)
downloadrneovim-9bab4b72ae4c996751a83badc1c2a183c7cbf5d2.tar.gz
rneovim-9bab4b72ae4c996751a83badc1c2a183c7cbf5d2.tar.bz2
rneovim-9bab4b72ae4c996751a83badc1c2a183c7cbf5d2.zip
vim-patch:9.0.1097: tests are failing
Problem: Tests are failing. Solution: Do clean up a hashtab when at the initial size. https://github.com/vim/vim/commit/b3d614369fceb891819badc941f80f08f57831f9 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--src/nvim/hashtab.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c
index 448e78ab07..55198d8e05 100644
--- a/src/nvim/hashtab.c
+++ b/src/nvim/hashtab.c
@@ -334,12 +334,13 @@ static void hash_may_resize(hashtab_T *ht, size_t minitems)
assert(newsize != 0);
}
- // bail out if the hashtab is already at the desired size
- if (newsize == ht->ht_mask + 1) {
+ bool newarray_is_small = newsize == HT_INIT_SIZE;
+
+ if (!newarray_is_small && newsize == ht->ht_mask + 1) {
+ // the hashtab is already at the desired size, bail out
return;
}
- bool newarray_is_small = newsize == HT_INIT_SIZE;
bool keep_smallarray = newarray_is_small
&& ht->ht_array == ht->ht_smallarray;