diff options
author | Freya Murphy <freya@freyacat.org> | 2023-12-16 11:47:59 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2023-12-16 11:47:59 -0500 |
commit | 85ba301f52b1c7e1ad928803b14b6c70776f2235 (patch) | |
tree | 28902147b9bf6c393497e21b0cb21c8b957aa3e2 /src/tag.c | |
parent | fix hang on incomplete json ident (diff) | |
download | nbtvis-85ba301f52b1c7e1ad928803b14b6c70776f2235.tar.gz nbtvis-85ba301f52b1c7e1ad928803b14b6c70776f2235.tar.bz2 nbtvis-85ba301f52b1c7e1ad928803b14b6c70776f2235.zip |
use hashmap for compound tag
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,4 +1,5 @@ #include "tag.h" +#include "map.h" #include "nbt/nbt.h" #include "json/json.h" @@ -28,9 +29,7 @@ void tag_free(tag_t *tag) { free(tag->data.list.tags); break; case TAG_COMPOUND: - for (int32_t i = 0; i < tag->data.compound.size; i++) - tag_free(&tag->data.compound.tags[i]); - free(tag->data.compound.tags); + map_free(&tag->data.compound); break; case TAG_INT_ARRAY: free(tag->data.i_arr.data); |