diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-21 06:08:00 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | c68fe7634341e97c3246b627a20fa9487586ffcb (patch) | |
tree | 78d499cc090439fa8fe087105e52f771d7728d23 /include/std | |
parent | f24139d455af3a179fe1d19c951e4cd85744c592 (diff) |
hash map contains
Diffstat (limited to 'include/std')
-rw-r--r-- | include/std/hash_map.h | 10 |
1 files changed, 6 insertions, 4 deletions
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); |