summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-11-20 08:54:03 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-11-20 08:54:03 -0800
commit8f85b1ba7afb77228cffb31452272854abfa931e (patch)
tree46f77acb1c97cc9a48fd8e2e0444ca4cce883614
parentcd62478108860e36b5cab30d85640492d0f32d91 (diff)
Minor refactoring of tree modification
Remove redundant this-> from type() call (argument used to be called type, but it's now type_). Use _root member directly when possible instead of calling internal_object.
-rw-r--r--src/pugixml.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index b69ba2c..75b5295 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -4970,7 +4970,7 @@ namespace pugi
PUGI__FN xml_node xml_node::append_child(xml_node_type type_)
{
- if (!impl::allow_insert_child(this->type(), type_)) return xml_node();
+ if (!impl::allow_insert_child(type(), type_)) return xml_node();
xml_node n(impl::allocate_node(impl::get_allocator(_root), type_));
if (!n) return xml_node();
@@ -4984,7 +4984,7 @@ namespace pugi
PUGI__FN xml_node xml_node::prepend_child(xml_node_type type_)
{
- if (!impl::allow_insert_child(this->type(), type_)) return xml_node();
+ if (!impl::allow_insert_child(type(), type_)) return xml_node();
xml_node n(impl::allocate_node(impl::get_allocator(_root), type_));
if (!n) return xml_node();
@@ -4998,7 +4998,7 @@ namespace pugi
PUGI__FN xml_node xml_node::insert_child_before(xml_node_type type_, const xml_node& node)
{
- if (!impl::allow_insert_child(this->type(), type_)) return xml_node();
+ if (!impl::allow_insert_child(type(), type_)) return xml_node();
if (!node._root || node._root->parent != _root) return xml_node();
xml_node n(impl::allocate_node(impl::get_allocator(_root), type_));
@@ -5013,7 +5013,7 @@ namespace pugi
PUGI__FN xml_node xml_node::insert_child_after(xml_node_type type_, const xml_node& node)
{
- if (!impl::allow_insert_child(this->type(), type_)) return xml_node();
+ if (!impl::allow_insert_child(type(), type_)) return xml_node();
if (!node._root || node._root->parent != _root) return xml_node();
xml_node n(impl::allocate_node(impl::get_allocator(_root), type_));
@@ -5066,7 +5066,7 @@ namespace pugi
{
xml_node result = append_child(proto.type());
- if (result) impl::node_copy_tree(result.internal_object(), proto.internal_object());
+ if (result) impl::node_copy_tree(result._root, proto._root);
return result;
}
@@ -5075,7 +5075,7 @@ namespace pugi
{
xml_node result = prepend_child(proto.type());
- if (result) impl::node_copy_tree(result.internal_object(), proto.internal_object());
+ if (result) impl::node_copy_tree(result._root, proto._root);
return result;
}
@@ -5084,7 +5084,7 @@ namespace pugi
{
xml_node result = insert_child_after(proto.type(), node);
- if (result) impl::node_copy_tree(result.internal_object(), proto.internal_object());
+ if (result) impl::node_copy_tree(result._root, proto._root);
return result;
}
@@ -5093,7 +5093,7 @@ namespace pugi
{
xml_node result = insert_child_before(proto.type(), node);
- if (result) impl::node_copy_tree(result.internal_object(), proto.internal_object());
+ if (result) impl::node_copy_tree(result._root, proto._root);
return result;
}