Mercurial > vim
comparison src/hashtab.c @ 21317:883aa425656a v8.2.1209
patch 8.2.1209: Vim9: test failure
Commit: https://github.com/vim/vim/commit/21c16f868d725fffc8fa36620cba33dd5f2ed576
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 14 16:15:34 2020 +0200
patch 8.2.1209: Vim9: test failure
Problem: Vim9: test failure.
Solution: Add missing changes to hashtab.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 14 Jul 2020 16:30:04 +0200 |
parents | aadd1cae2ff5 |
children | 4ed106deb772 |
comparison
equal
deleted
inserted
replaced
21316:9681f65ba9db | 21317:883aa425656a |
---|---|
234 // If resizing failed before and it fails again we can't add an item. | 234 // If resizing failed before and it fails again we can't add an item. |
235 if (ht->ht_error && hash_may_resize(ht, 0) == FAIL) | 235 if (ht->ht_error && hash_may_resize(ht, 0) == FAIL) |
236 return FAIL; | 236 return FAIL; |
237 | 237 |
238 ++ht->ht_used; | 238 ++ht->ht_used; |
239 ++ht->ht_changed; | |
239 if (hi->hi_key == NULL) | 240 if (hi->hi_key == NULL) |
240 ++ht->ht_filled; | 241 ++ht->ht_filled; |
241 hi->hi_key = key; | 242 hi->hi_key = key; |
242 hi->hi_hash = hash; | 243 hi->hi_hash = hash; |
243 | 244 |
269 */ | 270 */ |
270 void | 271 void |
271 hash_remove(hashtab_T *ht, hashitem_T *hi) | 272 hash_remove(hashtab_T *ht, hashitem_T *hi) |
272 { | 273 { |
273 --ht->ht_used; | 274 --ht->ht_used; |
275 ++ht->ht_changed; | |
274 hi->hi_key = HI_KEY_REMOVED; | 276 hi->hi_key = HI_KEY_REMOVED; |
275 hash_may_resize(ht, 0); | 277 hash_may_resize(ht, 0); |
276 } | 278 } |
277 | 279 |
278 /* | 280 /* |
446 if (ht->ht_array != ht->ht_smallarray) | 448 if (ht->ht_array != ht->ht_smallarray) |
447 vim_free(ht->ht_array); | 449 vim_free(ht->ht_array); |
448 ht->ht_array = newarray; | 450 ht->ht_array = newarray; |
449 ht->ht_mask = newmask; | 451 ht->ht_mask = newmask; |
450 ht->ht_filled = ht->ht_used; | 452 ht->ht_filled = ht->ht_used; |
453 ++ht->ht_changed; | |
451 ht->ht_error = FALSE; | 454 ht->ht_error = FALSE; |
452 | 455 |
453 return OK; | 456 return OK; |
454 } | 457 } |
455 | 458 |