diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-22 08:30:53 -0700 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-04-22 08:30:53 -0700 |
commit | 4223b4a3f0d2058fcfac551055550384b650f70a (patch) | |
tree | c4a51a3dfac100805ead71be1e7dfe22dc15800c | |
parent | e4e2259646ba5003e55f1969e6bde91ef37ff4b2 (diff) |
Make xml_node::value() structure consistent with set_*
-rw-r--r-- | src/pugixml.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 181d69a..80d9d9f 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -5378,14 +5378,13 @@ namespace pugi PUGI__FN const char_t* xml_node::value() const { - if (_root) - { - if (impl::has_value(_root) && _root->contents) - return _root->contents; + if (!_root) return PUGIXML_TEXT(""); - if (PUGI__NODETYPE(_root) == node_pi && static_cast<xml_node_pi_struct*>(_root)->pi_value) - return static_cast<xml_node_pi_struct*>(_root)->pi_value; - } + if (impl::has_value(_root) && _root->contents) + return _root->contents; + + if (PUGI__NODETYPE(_root) == node_pi && static_cast<xml_node_pi_struct*>(_root)->pi_value) + return static_cast<xml_node_pi_struct*>(_root)->pi_value; return PUGIXML_TEXT(""); } |