summaryrefslogtreecommitdiffstats
path: root/src/plist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plist.c')
-rw-r--r--src/plist.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plist.c b/src/plist.c
index f62e6be..cd22ca6 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -36,7 +36,6 @@
36#endif 36#endif
37 37
38#include <node.h> 38#include <node.h>
39#include <node_iterator.h>
40#include <hashtable.h> 39#include <hashtable.h>
41 40
42extern void plist_xml_init(void); 41extern void plist_xml_init(void);
@@ -209,12 +208,12 @@ static int plist_free_node(node_t* node)
209 plist_free_data(data); 208 plist_free_data(data);
210 node->data = NULL; 209 node->data = NULL;
211 210
212 node_iterator_t *ni = node_iterator_create(node->children);
213 node_t *ch; 211 node_t *ch;
214 while ((ch = node_iterator_next(ni))) { 212 for (ch = node_first_child(node); ch; ) {
213 node_t *next = node_next_sibling(ch);
215 plist_free_node(ch); 214 plist_free_node(ch);
215 ch = next;
216 } 216 }
217 node_iterator_destroy(ni);
218 217
219 node_destroy(node); 218 node_destroy(node);
220 219
@@ -366,12 +365,10 @@ static void plist_copy_node(node_t *node, void *parent_node_ptr)
366 *(plist_t*)parent_node_ptr = newnode; 365 *(plist_t*)parent_node_ptr = newnode;
367 } 366 }
368 367
369 node_iterator_t *ni = node_iterator_create(node->children);
370 node_t *ch; 368 node_t *ch;
371 while ((ch = node_iterator_next(ni))) { 369 for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) {
372 plist_copy_node(ch, &newnode); 370 plist_copy_node(ch, &newnode);
373 } 371 }
374 node_iterator_destroy(ni);
375} 372}
376 373
377PLIST_API plist_t plist_copy(plist_t node) 374PLIST_API plist_t plist_copy(plist_t node)