commit | 1346a174ae2f1282bbb93adf480093579fafad6e | [log] [tgz] |
---|---|---|
author | Lee Thomason <leethomason@gmail.com> | Wed Jun 14 15:14:19 2017 -0700 |
committer | Lee Thomason <leethomason@gmail.com> | Wed Jun 14 15:14:19 2017 -0700 |
tree | c0e382eebb88b6e768bccc2b3748fb3bb74b1749 | |
parent | 1bbc66b19322db9def93a0f69aaac2c046a01235 [diff] [blame] |
tweak comments. fix copy to self case.
diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 0168d9b..5c459a6 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp
@@ -2052,7 +2052,9 @@ void XMLDocument::DeepCopy(XMLDocument* target) { TIXMLASSERT(target); - TIXMLASSERT(target != this); + if (target == this) { + return; // technically success - a no-op. + } target->Clear(); for (const XMLNode* node = this->FirstChild(); node; node = node->NextSibling()) {