Add a comment to clarify subtle branch in node_copy_tree

This commit is contained in:
Arseny Kapoulkine 2018-03-29 08:27:56 -07:00
parent cec32da2b5
commit 951f1ed4ed

View File

@ -4423,6 +4423,7 @@ PUGI__NS_BEGIN
while (sit && sit != sn) while (sit && sit != sn)
{ {
// when a tree is copied into one of the descendants, we need to skip that subtree to avoid an infinite loop
if (sit != dn) if (sit != dn)
{ {
xml_node_struct* copy = append_new_node(dit, alloc, PUGI__NODETYPE(sit)); xml_node_struct* copy = append_new_node(dit, alloc, PUGI__NODETYPE(sit));