From 2c6a41a92e69cc54182401814d523b5a6db661de Mon Sep 17 00:00:00 2001 From: ngc92 <7938269+ngc92@users.noreply.github.com> Date: Thu, 30 Jul 2020 23:51:30 +0300 Subject: [PATCH] removed overhead of clear error --- tinyxml2.cpp | 7 +++++++ tinyxml2.h | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 1bacbe1..2c7f5ef 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -2427,6 +2427,13 @@ void XMLDocument::Print( XMLPrinter* streamer ) const } +void XMLDocument::ClearError() { + _errorID = XML_SUCCESS; + _errorLineNum = 0; + _errorStr.Reset(); +} + + void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... ) { TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT ); diff --git a/tinyxml2.h b/tinyxml2.h index 003ef43..771332c 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1873,9 +1873,8 @@ public: */ void DeleteNode( XMLNode* node ); - void ClearError() { - SetError(XML_SUCCESS, 0, 0); - } + /// Clears the error flags. + void ClearError(); /// Return true if there was an error parsing the document. bool Error() const {