From 324d53aec69dc02ee4aeb11d8671a88627cde98b Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylo-work@users.noreply.github.com> Date: Tue, 24 Mar 2020 19:43:58 +0100 Subject: Add files via upload --- c_lib/cmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c_lib/cmap.h b/c_lib/cmap.h index 8ebba47c..ee62134c 100644 --- a/c_lib/cmap.h +++ b/c_lib/cmap.h @@ -103,7 +103,7 @@ static inline void cmap_##tag##_destroy(CMap_##tag* self) { \ CMapEntry_##tag* e = self->_table.data, *end = e + cap; \ for (; e != end; ++e) if (e->hashx) cmapentry_##tag##_destroy(e); \ } \ - cvector_map_##tag##_destroy(&self->_table); \ + free(_cvector_alloced(self->_table.data)); \ } \ \ static inline size_t cmap_##tag##_reserve(CMap_##tag* self, size_t size); /* predeclared */ \ @@ -114,8 +114,7 @@ static inline void cmap_##tag##_clear(CMap_##tag* self) { \ } \ \ static inline void cmap_##tag##_swap(CMap_##tag* a, CMap_##tag* b) { \ - cvector_map_##tag##_swap(&a->_table, &b->_table); \ - c_swap(size_t, a->_size, b->_size); \ + c_swap(CMap_##tag, *a, *b); \ } \ \ static inline void cmap_##tag##_setMaxLoadFactor(CMap_##tag* self, double fac) { \ @@ -123,6 +122,7 @@ static inline void cmap_##tag##_setMaxLoadFactor(CMap_##tag* self, double fac) { if (cmap_size(*self) >= cmap_buckets(*self) * fac) \ cmap_##tag##_reserve(self, (size_t) (cmap_size(*self) / fac)); \ } \ + \ static inline void cmap_##tag##_setShrinkLimitFactor(CMap_##tag* self, double limit) { \ self->shrinkLimitPercent = (uint8_t) (limit * 100); \ if (cmap_size(*self) < cmap_buckets(*self) * limit) \ -- cgit v1.2.3