Skip to content

Commit e48a379

Browse files
committed
ets hash table: rename status enum
Signed-off-by: Jakub Gonet <jakub.gonet@swmansion.com>
1 parent cf1a892 commit e48a379

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/libAtomVM/ets_hashtable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct HNode *ets_hashtable_new_node(term entry, int keypos)
115115
return NULL;
116116
}
117117

118-
EtsHashtableErrorCode ets_hashtable_insert(struct EtsHashTable *hash_table, struct HNode *new_node, EtsHashtableOptions opts, GlobalContext *global)
118+
EtsHashtableStatus ets_hashtable_insert(struct EtsHashTable *hash_table, struct HNode *new_node, EtsHashtableOptions opts, GlobalContext *global)
119119
{
120120
term key = new_node->key;
121121
uint32_t hash = hash_term(key, global);
@@ -132,7 +132,7 @@ EtsHashtableErrorCode ets_hashtable_insert(struct EtsHashTable *hash_table, stru
132132
while (node) {
133133
TermCompareResult cmp = term_compare(key, node->key, TermCompareExact, global);
134134
if (UNLIKELY(cmp == TermCompareMemoryAllocFail)) {
135-
return EtsHashtableError;
135+
return EtsHashtableOutOfMemory;
136136
}
137137

138138
if (cmp == TermEquals) {

src/libAtomVM/ets_hashtable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ typedef enum EtsHashtableOptions
4242
EtsHashtableAllowOverwrite = 1
4343
} EtsHashtableOptions;
4444

45-
typedef enum EtsHashtableErrorCode
45+
typedef enum EtsHashtableStatus
4646
{
4747
EtsHashtableOk = 0,
4848
EtsHashtableKeyAlreadyExists,
49-
EtsHashtableError
50-
} EtsHashtableErrorCode;
49+
EtsHashtableOutOfMemory
50+
} EtsHashtableStatus;
5151

5252
struct EtsHashTable *ets_hashtable_new();
5353
void ets_hashtable_destroy(struct EtsHashTable *hash_table, GlobalContext *global);
5454

55-
EtsHashtableErrorCode ets_hashtable_insert(struct EtsHashTable *hash_table, struct HNode *new_node, EtsHashtableOptions opts, GlobalContext *global);
55+
EtsHashtableStatus ets_hashtable_insert(struct EtsHashTable *hash_table, struct HNode *new_node, EtsHashtableOptions opts, GlobalContext *global);
5656
term ets_hashtable_lookup(struct EtsHashTable *hash_table, term key, size_t keypos, GlobalContext *global);
5757
bool ets_hashtable_remove(struct EtsHashTable *hash_table, term key, size_t keypos, GlobalContext *global);
5858
struct HNode *ets_hashtable_new_node(term entry, int keypos);

0 commit comments

Comments
 (0)