1
0
forked from aniani/vim

patch 9.0.1096: reallocating hashtab when the size didn't change

Problem:    Reallocating hashtab when the size didn't change.
Solution:   Bail out when the hashtab is already the desired size.
This commit is contained in:
Bram Moolenaar
2022-12-25 20:46:13 +00:00
parent 6ef5471afa
commit 71d53e7c57
2 changed files with 6 additions and 0 deletions

View File

@@ -405,6 +405,10 @@ hash_may_resize(
return FAIL; // overflow return FAIL; // overflow
} }
// bail out if the hashtab is already at the desired size
if (newsize == ht->ht_mask + 1)
return OK;
if (newsize == HT_INIT_SIZE) if (newsize == HT_INIT_SIZE)
{ {
// Use the small array inside the hashdict structure. // Use the small array inside the hashdict structure.

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1096,
/**/ /**/
1095, 1095,
/**/ /**/