Avoid unneeded printer object creation

This commit is contained in:
Dmitry-Me 2015-05-08 18:08:18 +03:00
parent e5e5541af6
commit 67c429e4b4
1 changed files with 6 additions and 4 deletions

View File

@ -1928,12 +1928,14 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
void XMLDocument::Print( XMLPrinter* streamer ) const
{
XMLPrinter stdStreamer( stdout );
if ( !streamer ) {
streamer = &stdStreamer;
}
if ( streamer ) {
Accept( streamer );
}
else {
XMLPrinter stdoutStreamer( stdout );
Accept( &stdoutStreamer );
}
}
void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )