diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-02-11 16:47:32 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-02-11 16:47:32 +0100 |
| commit | cd18a78e924f262fda022cdaab1fc681cce42fec (patch) | |
| tree | de17016bd7a3b189114362deb728d3b623a6af9e /src/hash.h | |
| parent | a1dee625dae4c3e39eb6ef16b91be9a374f7874f (diff) | |
starting to upload fonts
Diffstat (limited to 'src/hash.h')
| -rw-r--r-- | src/hash.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -81,16 +81,18 @@ inline V* wayc_hashmap_insert(hashmap_s<K, V>* map, const K* key, } template <typename K, typename V> -inline V* wayc_hashmap_get(hashmap_s<K, V>* map, const K* key) { +inline bool wayc_hashmap_get(hashmap_s<K, V>* map, const K* key, V* out) { wayc_notnull(map); wayc_notnull(key); + wayc_notnull(out); hashentry_s<K, V> entry{}; entry.key = *key; auto* stored = (hashentry_s<K, V>*)hashmap_get(map->inner, &entry); - if (!stored) return nullptr; + if (!stored) return false; - return &stored->value; + *out = stored->value; + return true; } template <typename K, typename V> |
