aboutsummaryrefslogtreecommitdiff
path: root/src/std/hash_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/std/hash_map.c')
-rw-r--r--src/std/hash_map.c4
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;