summaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 16:47:32 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 16:47:32 +0100
commitcd18a78e924f262fda022cdaab1fc681cce42fec (patch)
treede17016bd7a3b189114362deb728d3b623a6af9e /src/hash.h
parenta1dee625dae4c3e39eb6ef16b91be9a374f7874f (diff)
starting to upload fonts
Diffstat (limited to 'src/hash.h')
-rw-r--r--src/hash.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/hash.h b/src/hash.h
index f13c63d..bc8e22a 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -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>