diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-02-11 17:41:33 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-02-11 17:41:33 +0100 |
commit | 6cad09ec9c801e90d41f53ebcd673ef89050cc86 (patch) | |
tree | a57b30c824c663ed7730a6df6f2478a4a5b500e8 /src/std/hash_map.c | |
parent | 8d1532abb6f7441e00ffbc7ed4d0231e5023e19a (diff) |
Diffstat (limited to 'src/std/hash_map.c')
-rw-r--r-- | src/std/hash_map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/std/hash_map.c b/src/std/hash_map.c index b4bd4c1..4bf55c6 100644 --- a/src/std/hash_map.c +++ b/src/std/hash_map.c @@ -224,6 +224,9 @@ bool hash_map_get_ref(HashMap *self, BufferView key, void **value) { HashMapBucketNode *bucket_node; bucket_size = buffer_get_size(&self->buckets, HashMapBucket); + if(bucket_size == 0) + return bool_false; + hash = self->hash_func((const u8*)key.data, key.size); bucket_index = hash % bucket_size; |