changeset 31529:52c9b288ce86 v9.0.1097

patch 9.0.1097: tests are failing Commit: https://github.com/vim/vim/commit/b3d614369fceb891819badc941f80f08f57831f9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 25 21:32:09 2022 +0000 patch 9.0.1097: tests are failing Problem: Tests are failing. Solution: Do clean up a hashtab when at the initial size.
author Bram Moolenaar <Bram@vim.org>
date Sun, 25 Dec 2022 22:45:03 +0100
parents 066d8bd396bc
children 4f57d68cd1c6
files src/hashtab.c src/version.c
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/hashtab.c
+++ b/src/hashtab.c
@@ -405,10 +405,6 @@ hash_may_resize(
 	    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)
     {
 	// Use the small array inside the hashdict structure.
@@ -425,6 +421,13 @@ hash_may_resize(
 	    oldarray = ht->ht_array;
 	CLEAR_FIELD(ht->ht_smallarray);
     }
+
+    else if (newsize == ht->ht_mask + 1)
+    {
+	// the hashtab is already at the desired size, bail out
+	return OK;
+    }
+
     else
     {
 	// Allocate an array.
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1097,
+/**/
     1096,
 /**/
     1095,