From 85ba301f52b1c7e1ad928803b14b6c70776f2235 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 16 Dec 2023 11:47:59 -0500 Subject: use hashmap for compound tag --- src/tag.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index 25d9d32..d704b13 100644 --- a/src/tag.c +++ b/src/tag.c @@ -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); -- cgit v1.2.3-freya