From c68fe7634341e97c3246b627a20fa9487586ffcb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 21 Aug 2019 06:08:00 +0200 Subject: hash map contains --- include/std/hash_map.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include/std/hash_map.h') diff --git a/include/std/hash_map.h b/include/std/hash_map.h index d789db4..c9e5b51 100644 --- a/include/std/hash_map.h +++ b/include/std/hash_map.h @@ -25,15 +25,17 @@ struct HashMap { CHECK_RESULT int hash_map_init(HashMap *self, ArenaAllocator *allocator, usize value_type_size, HashMapCompare key_compare_func, HashMapHash key_hash_func); /* -Not thread-safe. -Expected @value size to be @self->value_type_size. + Not thread-safe. + Expected @value size to be @self->value_type_size. */ CHECK_RESULT int hash_map_insert(HashMap *self, BufferView key, void *value); /* -Thread-safe unless @hash_map_insert is used in another thread at the same time. -Expected @value size to be @self->value_type_size. + Thread-safe unless @hash_map_insert is used in another thread at the same time. + Expected @value size to be @self->value_type_size. + If @value is NULL, then the value is not copied and the functions works the same as @hash_map_contains */ CHECK_RESULT bool hash_map_get(HashMap *self, BufferView key, void *value); +CHECK_RESULT bool hash_map_contains(HashMap *self, BufferView key); int hash_map_compare_string(const void *a, const void *b); -- cgit v1.2.3