From 4de329327ce4aa175e8496d1bff8604bffb6c574 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 10 Dec 2018 02:20:24 +0100 Subject: Remove node_iterator and operate on node list directly to improve memory usage --- src/xplist.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/xplist.c') diff --git a/src/xplist.c b/src/xplist.c index 6e64427..29b1284 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -40,7 +40,6 @@ #include #include -#include #include "plist.h" #include "base64.h" @@ -356,12 +355,10 @@ static void node_to_xml(node_t* node, bytearray_t **outbuf, uint32_t depth) if (node_data->type == PLIST_DICT) { assert((node->children->count % 2) == 0); } - node_iterator_t *ni = node_iterator_create(node->children); node_t *ch; - while ((ch = node_iterator_next(ni))) { + for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) { node_to_xml(ch, outbuf, depth+1); } - node_iterator_destroy(ni); } /* fix indent for structured types */ -- cgit v1.1-32-gdbae