diff options
| author | Tyge Løvset <[email protected]> | 2020-03-21 17:27:50 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-21 17:27:50 +0100 |
| commit | 67c83a1555385ca1a20f3eae7817d613a012a1af (patch) | |
| tree | f2a83412b3a868962eca037bed978fe3c0ed3cc1 | |
| parent | 04e1aafd85f6e4246604a97f925b81dc88f652af (diff) | |
| download | STC-modified-67c83a1555385ca1a20f3eae7817d613a012a1af.tar.gz STC-modified-67c83a1555385ca1a20f3eae7817d613a012a1af.zip | |
Add files via upload
| -rw-r--r-- | c_lib/cmap.h | 5 |
1 files 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) { \
|
