mirror of https://github.com/AxioDL/tinyxml2.git
Avoid unneeded printer object creation
This commit is contained in:
parent
e5e5541af6
commit
67c429e4b4
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
|
void XMLDocument::Print( XMLPrinter* streamer ) const
|
||||||
{
|
{
|
||||||
XMLPrinter stdStreamer( stdout );
|
if ( streamer ) {
|
||||||
if ( !streamer ) {
|
Accept( streamer );
|
||||||
streamer = &stdStreamer;
|
}
|
||||||
|
else {
|
||||||
|
XMLPrinter stdoutStreamer( stdout );
|
||||||
|
Accept( &stdoutStreamer );
|
||||||
}
|
}
|
||||||
Accept( streamer );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue