Update container free methods (#58)

This commit is contained in:
2022-08-26 12:46:59 +03:00
parent 0881ba9076
commit 4dfe971282
6 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ inline size_t array_size (const vtype_array* x) { return x->size; }
inline size_t dict_size (const vtype_dict* x) { return x->size; }
inline size_t dict_capacity(const vtype_dict* x) { return x->capacity; }
inline size_t string_nmemb (const vtype_string* x) { return (x->buffer) ? libcdsb_strlen(x->buffer) : 0; }
inline void string_free ( vtype_string* x) { libcdsb_free(x->buffer); x->buffer = 0; }
inline void string_free ( vtype_string* x) { if (x) { libcdsb_free(x->buffer); x->buffer = 0; } }
inline vtype_string string_copy(const vtype_string* s) {
vtype_string x = { .buffer = libcdsb_strdup(s->buffer) };