From e6e0aba8c31f5c9ccec7d0113d63f5104df74ea1 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 10 Sep 2017 15:17:37 +0100 Subject: Remove `when` suffixes; Implement file scope `when` statement, evaluated in source order --- src/map.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/map.cpp') 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 void map_init (Map *h, gbAllocator a); -template void map_init_with_reserve(Map *h, gbAllocator a, isize capacity); +template void map_init (Map *h, gbAllocator a, isize capacity = 16); template void map_destroy (Map *h); template T * map_get (Map *h, HashKey key); template void map_set (Map *h, HashKey key, T const &value); @@ -123,13 +122,7 @@ template void multi_map_remove_all(Map *h, HashKey key); template -gb_inline void map_init(Map *h, gbAllocator a) { - array_init(&h->hashes, a); - array_init(&h->entries, a); -} - -template -gb_inline void map_init_with_reserve(Map *h, gbAllocator a, isize capacity) { +gb_inline void map_init(Map *h, gbAllocator a, isize capacity) { array_init(&h->hashes, a, capacity); array_init(&h->entries, a, capacity); } -- cgit v1.2.3