diff options
| author | 2018-12-10 02:20:24 +0100 | |
|---|---|---|
| committer | 2018-12-10 02:22:15 +0100 | |
| commit | 4de329327ce4aa175e8496d1bff8604bffb6c574 (patch) | |
| tree | 0c5fce7e138756a2479acab5a3098fa12ea6971b /src/xplist.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 'src/xplist.c')
| -rw-r--r-- | src/xplist.c | 5 |
1 files changed, 1 insertions, 4 deletions
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 @@ | |||
| 40 | 40 | ||
| 41 | #include <node.h> | 41 | #include <node.h> |
| 42 | #include <node_list.h> | 42 | #include <node_list.h> |
| 43 | #include <node_iterator.h> | ||
| 44 | 43 | ||
| 45 | #include "plist.h" | 44 | #include "plist.h" |
| 46 | #include "base64.h" | 45 | #include "base64.h" |
| @@ -356,12 +355,10 @@ static void node_to_xml(node_t* node, bytearray_t **outbuf, uint32_t depth) | |||
| 356 | if (node_data->type == PLIST_DICT) { | 355 | if (node_data->type == PLIST_DICT) { |
| 357 | assert((node->children->count % 2) == 0); | 356 | assert((node->children->count % 2) == 0); |
| 358 | } | 357 | } |
| 359 | node_iterator_t *ni = node_iterator_create(node->children); | ||
| 360 | node_t *ch; | 358 | node_t *ch; |
| 361 | while ((ch = node_iterator_next(ni))) { | 359 | for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) { |
| 362 | node_to_xml(ch, outbuf, depth+1); | 360 | node_to_xml(ch, outbuf, depth+1); |
| 363 | } | 361 | } |
| 364 | node_iterator_destroy(ni); | ||
| 365 | } | 362 | } |
| 366 | 363 | ||
| 367 | /* fix indent for structured types */ | 364 | /* fix indent for structured types */ |
