aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2017-12-12 18:21:40 +0000
committergingerBill <bill@gingerbill.org>2017-12-12 18:21:40 +0000
commitf7e9649be466ea03f556e2918063c5a4d0d28e2e (patch)
tree254ccca62132e5fae8af7bbf03ffe7fc5b75f0a4 /src/map.cpp
parentfd1f6ec75cf7e26e2e87f84885e4166cd25cf376 (diff)
Disable struct field reordering (for the time being)
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 152b8cb39..0ff39cac6 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -127,14 +127,12 @@ 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, isize capacity) {
array_init(&h->hashes, a, capacity);
- array_init(&h->entries, a, capacity);
-}
+ array_init(&h->entries, a, capacity);}
template <typename T>
gb_inline void map_destroy(Map<T> *h) {
array_free(&h->entries);
- array_free(&h->hashes);
-}
+ array_free(&h->hashes);}
template <typename T>
gb_internal isize map__add_entry(Map<T> *h, HashKey key) {
@@ -237,8 +235,9 @@ template <typename T>
void map_set(Map<T> *h, HashKey key, T const &value) {
isize index;
MapFindResult fr;
- if (h->hashes.count == 0)
+ if (h->hashes.count == 0) {
map_grow(h);
+ }
fr = map__find(h, key);
if (fr.entry_index >= 0) {
index = fr.entry_index;