diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-04-22 02:34:30 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | a76ba1b33e397638c4209dd77e6073e423ac07a8 (patch) | |
tree | 0ef62209546ba91d53a2fabb54f3b8ac9dcfafdf /src/std/hash_map.c | |
parent | 6a9466da5377d0bc73c7e5aa48deca3740d3de6f (diff) |
Start on bytecode. Commit before os switch
Diffstat (limited to 'src/std/hash_map.c')
-rw-r--r-- | src/std/hash_map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/std/hash_map.c b/src/std/hash_map.c index d9914e7..d13bf3d 100644 --- a/src/std/hash_map.c +++ b/src/std/hash_map.c @@ -84,7 +84,7 @@ int hash_map_init(HashMap *self, ScopedAllocator *allocator, usize value_type_si self->hash_func = hash_func; return_if_error(buffer_init(&self->buckets, self->allocator)); assert(self->buckets.size == 0); - return_if_error(buffer_append(&self->buckets, NULL, sizeof(HashMapBucket) * HASH_MAP_INITIAL_SIZE)); + return_if_error(buffer_append_empty(&self->buckets, sizeof(HashMapBucket) * HASH_MAP_INITIAL_SIZE)); am_memset(self->buckets.data, 0, self->buckets.size); return 0; } @@ -150,7 +150,7 @@ static CHECK_RESULT int hash_map_increase_buckets(HashMap *self) { usize bytes_to_append; prev_num_elements = buffer_get_size(&self->buckets, HashMapBucket); bytes_to_append = (usize)(prev_num_elements * 1.5) * sizeof(HashMapBucket); - return_if_error(buffer_append(&self->buckets, NULL, bytes_to_append)); + return_if_error(buffer_append_empty(&self->buckets, bytes_to_append)); am_memset(((HashMapBucket*)self->buckets.data) + prev_num_elements, 0, bytes_to_append); hash_map_reorder_nodes(self, prev_num_elements); return 0; |