diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-09-10 15:17:37 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-09-10 15:17:37 +0100 |
| commit | e6e0aba8c31f5c9ccec7d0113d63f5104df74ea1 (patch) | |
| tree | 9639829bffca6db52441b6de8f3ece5134af9610 /src/map.cpp | |
| parent | 85097a995839f7e2911abdec9665c1af22960c00 (diff) | |
Remove `when` suffixes; Implement file scope `when` statement, evaluated in source order
Diffstat (limited to 'src/map.cpp')
| -rw-r--r-- | src/map.cpp | 11 |
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); } |