From 71d53e7c579b8af44083142ea3894b455947ad81 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 25 Dec 2022 20:46:13 +0000 Subject: [PATCH] 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. --- src/hashtab.c | 4 ++++ src/version.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/hashtab.c b/src/hashtab.c index db76fde35f..0c1aca2c5b 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -405,6 +405,10 @@ 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. diff --git a/src/version.c b/src/version.c index 36d3f81ff8..deaee33566 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1096, /**/ 1095, /**/