diff options
author | Nikias Bassen | 2018-12-10 02:20:24 +0100 |
---|---|---|
committer | Nikias Bassen | 2018-12-10 02:22:15 +0100 |
commit | 4de329327ce4aa175e8496d1bff8604bffb6c574 (patch) | |
tree | 0c5fce7e138756a2479acab5a3098fa12ea6971b /libcnary/node.c | |
parent | 71dd25e14616bd261c3b6c80ff990cd1078266f6 (diff) | |
download | libplist-4de329327ce4aa175e8496d1bff8604bffb6c574.tar.gz libplist-4de329327ce4aa175e8496d1bff8604bffb6c574.tar.bz2 |
Remove node_iterator and operate on node list directly to improve memory usage
Diffstat (limited to 'libcnary/node.c')
-rw-r--r-- | libcnary/node.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libcnary/node.c b/libcnary/node.c index 4b550dd..c24ca7a 100644 --- a/libcnary/node.c +++ b/libcnary/node.c @@ -26,7 +26,6 @@ #include "node.h" #include "node_list.h" -#include "node_iterator.h" void node_destroy(node_t* node) { if(!node) return; @@ -114,7 +113,6 @@ int node_insert(node_t* parent, unsigned int node_index, node_t* child) static void _node_debug(node_t* node, unsigned int depth) { unsigned int i = 0; node_t* current = NULL; - node_iterator_t* iter = NULL; for(i = 0; i < depth; i++) { printf("\t"); } @@ -128,11 +126,9 @@ static void _node_debug(node_t* node, unsigned int depth) { if(node->parent) { printf("NODE\n"); } - iter = node_iterator_create(node->children); - while ((current = iter->next(iter))) { + for (current = node_first_child(node); current; current = node_next_sibling(current)) { _node_debug(current, depth+1); } - node_iterator_destroy(iter); } } |