diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-11-19 19:50:40 -0800 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-11-19 19:50:40 -0800 |
commit | 5c5038c264ed7ecb02048257b956e5206c07a566 (patch) | |
tree | 0c323726a87c09e579fa7bdd0956ca30e9ca9c32 /src/pugixml.cpp | |
parent | 417048d8cb8eb7cf3f4391aacd915b654f98c18e (diff) |
Change has_declaration to work on node pointers
This is more for consistency with the surrounding code than for performance.
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 3f6b2fd..f2f1dd9 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -3658,11 +3658,11 @@ PUGI__NS_BEGIN while (node != root); } - PUGI__FN bool has_declaration(xml_node node) + PUGI__FN bool has_declaration(xml_node_struct* node) { - for (xml_node child = node.first_child(); child; child = child.next_sibling()) + for (xml_node_struct* child = node->first_child; child; child = child->next_sibling) { - xml_node_type type = child.type(); + xml_node_type type = PUGI__NODETYPE(child); if (type == node_declaration) return true; if (type == node_element) return false; @@ -6066,7 +6066,7 @@ namespace pugi #endif } - if (!(flags & format_no_declaration) && !impl::has_declaration(*this)) + if (!(flags & format_no_declaration) && !impl::has_declaration(_root)) { buffered_writer.write_string(PUGIXML_TEXT("<?xml version=\"1.0\"")); if (encoding == encoding_latin1) buffered_writer.write_string(PUGIXML_TEXT(" encoding=\"ISO-8859-1\"")); |