diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:03:15 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:03:15 +0000 |
commit | c779ee05ce45505ab007990b1b11864923c03e81 (patch) | |
tree | 0a07d47b608edd3b84d598e69dbab8b472d00873 | |
parent | b88cf138f9a4aa54aa891518fccb4160f12b9918 (diff) |
Minor iterator refactoring
git-svn-id: http://pugixml.googlecode.com/svn/trunk@635 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r-- | src/pugixml.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 88f7cc2..857d656 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -4153,8 +4153,7 @@ namespace pugi const xml_node_iterator& xml_node_iterator::operator--() { - if (_wrap._root) _wrap = _wrap.previous_sibling(); - else _wrap = _parent.last_child(); + _wrap = _wrap._root ? _wrap.previous_sibling() : _parent.last_child(); return *this; } @@ -4215,8 +4214,7 @@ namespace pugi const xml_attribute_iterator& xml_attribute_iterator::operator--() { - if (_wrap._attr) _wrap = _wrap.previous_attribute(); - else _wrap = _parent.last_attribute(); + _wrap = _wrap._attr ? _wrap.previous_attribute() : _parent.last_attribute(); return *this; } |