No OOM in hash_may_resize() and hash_add_item()

hash_add() can still return FAIL if the key already exists.
This commit is contained in:
Felipe Oliveira Carvalho
2014-05-28 18:24:23 -03:00
parent 6f29364632
commit 48fc1602be
3 changed files with 14 additions and 30 deletions

View File

@@ -59,8 +59,6 @@ typedef struct hashtable_S {
size_t ht_used; /// number of items used
size_t ht_filled; /// number of items used or removed
int ht_locked; /// counter for hash_lock()
bool ht_error; /// when set growing failed, can't add more
/// items before growing works
hashitem_T *ht_array; /// points to the array, allocated when it's
/// not "ht_smallarray"
hashitem_T ht_smallarray[HT_INIT_SIZE]; /// initial array
@@ -69,4 +67,5 @@ typedef struct hashtable_S {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "hashtab.h.generated.h"
#endif
#endif // NVIM_HASHTAB_H