diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-10-25 03:17:55 +0000 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-10-25 03:17:55 +0000 |
commit | 4363e8a651c2ca24d7fc41e5707bc44ed102e94a (patch) | |
tree | ee91b5e4391c82bbd15341c19d831450015c1bc1 /src/pugixml.cpp | |
parent | 7b74531c1badc08b15983a34a85f837c2bd0a8e7 (diff) |
Remove redundant null pointer checks.
When removing a node or attribute, we know that the parent has at least one
node/attribute so a null pointer check is redundant.
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1078 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index abe7adf..1187383 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -700,7 +700,7 @@ PUGI__NS_BEGIN if (node->next_sibling) node->next_sibling->prev_sibling_c = node->prev_sibling_c; - else if (parent->first_child) + else parent->first_child->prev_sibling_c = node->prev_sibling_c; if (node->prev_sibling_c->next_sibling) @@ -775,7 +775,7 @@ PUGI__NS_BEGIN { if (attr->next_attribute) attr->next_attribute->prev_attribute_c = attr->prev_attribute_c; - else if (node->first_attribute) + else node->first_attribute->prev_attribute_c = attr->prev_attribute_c; if (attr->prev_attribute_c->next_attribute) |