From 67c83a1555385ca1a20f3eae7817d613a012a1af Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylo-work@users.noreply.github.com> Date: Sat, 21 Mar 2020 17:27:50 +0100 Subject: Add files via upload --- c_lib/cmap.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/c_lib/cmap.h b/c_lib/cmap.h index b71bc174..c8f1079f 100644 --- a/c_lib/cmap.h +++ b/c_lib/cmap.h @@ -108,9 +108,8 @@ static inline void cmap_##tag##_destroy(CMap_##tag* self) { \ static inline size_t cmap_##tag##_reserve(CMap_##tag* self, size_t size); /* predeclared */ \ \ static inline void cmap_##tag##_clear(CMap_##tag* self) { \ - CMap_##tag map = cmap_initializer; \ - cmap_##tag##_destroy(self); \ - *self = map; \ + memset(self->_table.data, 0, sizeof(CMapEntry_##tag) * _cvector_capacity(self->_table)); \ + self->_size = 0; \ } \ \ static inline void cmap_##tag##_swap(CMap_##tag* a, CMap_##tag* b) { \ -- cgit v1.2.3