summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-22 08:30:53 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-04-22 08:30:53 -0700
commit4223b4a3f0d2058fcfac551055550384b650f70a (patch)
treec4a51a3dfac100805ead71be1e7dfe22dc15800c /src
parente4e2259646ba5003e55f1969e6bde91ef37ff4b2 (diff)
Make xml_node::value() structure consistent with set_*
Diffstat (limited to 'src')
-rw-r--r--src/pugixml.cpp13
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("");
}