mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user