mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #330 from Dmitry-Me/avoidUnneededPrinterCreation
Avoid unneeded printer object creation
This commit is contained in:
commit
1bf04fd755
10
tinyxml2.cpp
10
tinyxml2.cpp
|
@ -1928,11 +1928,13 @@ 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 );
|
||||
}
|
||||
Accept( streamer );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue