From 4223b4a3f0d2058fcfac551055550384b650f70a Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 22 Apr 2015 08:30:53 -0700 Subject: Make xml_node::value() structure consistent with set_* --- src/pugixml.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') 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(_root)->pi_value) - return static_cast(_root)->pi_value; - } + if (impl::has_value(_root) && _root->contents) + return _root->contents; + + if (PUGI__NODETYPE(_root) == node_pi && static_cast(_root)->pi_value) + return static_cast(_root)->pi_value; return PUGIXML_TEXT(""); } -- cgit v1.2.3