From 4363e8a651c2ca24d7fc41e5707bc44ed102e94a Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 25 Oct 2014 03:17:55 +0000 Subject: 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 --- src/pugixml.cpp | 4 ++-- 1 file 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) -- cgit v1.2.3