[xml] Minor code cleanup in tree.c
- From: Anthony Jones <amj30 cam ac uk>
- To: xml gnome org
- Subject: [xml] Minor code cleanup in tree.c
- Date: Tue, 15 Jan 2002 17:50:40 +0000
In xmlNodeDump() when dumping a XML_PI_NODE, we currently have a redundant
test for cur->content != NULL. This patch removes that, and shouldn't
change the behaviour at all.
Anthony
--- tree.c 2002/01/14 17:11:53 1.178
+++ tree.c 2002/01/15 17:38:47
@@ -5701,23 +5701,17 @@
return;
}
if (cur->type == XML_PI_NODE) {
+ xmlBufferWriteChar(buf, "<?");
+ xmlBufferWriteCHAR(buf, cur->name);
if (cur->content != NULL) {
- xmlBufferWriteChar(buf, "<?");
- xmlBufferWriteCHAR(buf, cur->name);
- if (cur->content != NULL) {
- xmlBufferWriteChar(buf, " ");
+ xmlBufferWriteChar(buf, " ");
#ifndef XML_USE_BUFFER_CONTENT
- xmlBufferWriteCHAR(buf, cur->content);
+ xmlBufferWriteCHAR(buf, cur->content);
#else
- xmlBufferWriteCHAR(buf, xmlBufferContent(cur->content));
+ xmlBufferWriteCHAR(buf, xmlBufferContent(cur->content));
#endif
- }
- xmlBufferWriteChar(buf, "?>");
- } else {
- xmlBufferWriteChar(buf, "<?");
- xmlBufferWriteCHAR(buf, cur->name);
- xmlBufferWriteChar(buf, "?>");
}
+ xmlBufferWriteChar(buf, "?>");
return;
}
if (cur->type == XML_COMMENT_NODE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]