diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2004-11-25 16:37:53 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2004-11-25 16:37:53 +0000 |
| commit | 88da52d408024c06c0b470e7be4d6864aeb8d808 (patch) | |
| tree | 49945eac149040ded57e10a6f3f286a47aec58c0 | |
| parent | bc8741af4ba373ec04c02a25ff8489753ec0466d (diff) | |
| download | lasso-88da52d408024c06c0b470e7be4d6864aeb8d808.tar.gz lasso-88da52d408024c06c0b470e7be4d6864aeb8d808.tar.xz lasso-88da52d408024c06c0b470e7be4d6864aeb8d808.zip | |
don't loop twice on xmlsnippets
| -rw-r--r-- | lasso/xml/xml.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 21552c64..2c4b9109 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -764,18 +764,13 @@ lasso_node_build_xml_with_snippets(xmlNode *node, struct XmlSnippet *snippets) continue; if (snippets[i].type == 'a') /* attribute */ xmlSetProp(node, snippets[i].name, (char*)(*(snippets[i].value))); - } - - for (i = 0; snippets[i].name; i++) { - if (*(snippets[i].value) == NULL) - continue; - if (snippets[i].type == 'n') + if (snippets[i].type == 'n') /* node */ xmlAddChild(node, lasso_node_get_xmlNode( LASSO_NODE(*(snippets[i].value)))); - if (snippets[i].type == 'c') + if (snippets[i].type == 'c') /* content */ xmlNewTextChild(node, NULL, snippets[i].name, (char*)(*(snippets[i].value))); - if (snippets[i].type == 'i') { + if (snippets[i].type == 'i') { /* name identifier */ xmlNode *t; xmlNs *xmlns; xmlns = xmlNewNs(node, LASSO_LIB_HREF, LASSO_LIB_PREFIX); |
