aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-09-10 15:17:37 +0100
committerGinger Bill <bill@gingerbill.org>2017-09-10 15:17:37 +0100
commite6e0aba8c31f5c9ccec7d0113d63f5104df74ea1 (patch)
tree9639829bffca6db52441b6de8f3ece5134af9610 /src/map.cpp
parent85097a995839f7e2911abdec9665c1af22960c00 (diff)
Remove `when` suffixes; Implement file scope `when` statement, evaluated in source order
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 4d75270fb..92840a480 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -101,8 +101,7 @@ struct Map {
};
-template <typename T> void map_init (Map<T> *h, gbAllocator a);
-template <typename T> void map_init_with_reserve(Map<T> *h, gbAllocator a, isize capacity);
+template <typename T> void map_init (Map<T> *h, gbAllocator a, isize capacity = 16);
template <typename T> void map_destroy (Map<T> *h);
template <typename T> T * map_get (Map<T> *h, HashKey key);
template <typename T> void map_set (Map<T> *h, HashKey key, T const &value);
@@ -123,13 +122,7 @@ template <typename T> void multi_map_remove_all(Map<T> *h, HashKey key);
template <typename T>
-gb_inline void map_init(Map<T> *h, gbAllocator a) {
- array_init(&h->hashes, a);
- array_init(&h->entries, a);
-}
-
-template <typename T>
-gb_inline void map_init_with_reserve(Map<T> *h, gbAllocator a, isize capacity) {
+gb_inline void map_init(Map<T> *h, gbAllocator a, isize capacity) {
array_init(&h->hashes, a, capacity);
array_init(&h->entries, a, capacity);
}