Cut xml writing time down by a third for catalog.xml by not concatenating strings before calling Write.

This commit is contained in:
Steve Checkoway
2007-02-04 10:44:45 +00:00
parent 169d7c8b44
commit 6d2fa387d8
+3 -3
View File
@@ -404,7 +404,7 @@ bool GetAttrXML( RageFileBasic &f, const RString &sName, const RString &sValue )
{
RString s(sValue);
ReplaceEntityText( s, g_mapCharsToEntities );
return f.Write(sName + "='" + s + "' ") != -1;
return f.Write( sName ) != -1 && f.Write( "='" ) != -1 && f.Write( s ) && f.Write( "' " ) != -1;
}
bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int &iTabBase )
@@ -418,7 +418,7 @@ bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int
return false;
// <TAG
if( f.Write("<" + pNode->GetName()) == -1 )
if( f.Write("<") == -1 || f.Write(pNode->GetName()) == -1 )
return false;
// <TAG Attr1="Val1"
@@ -477,7 +477,7 @@ bool GetXMLInternal( const XNode *pNode, RageFileBasic &f, bool bWriteTabs, int
if( f.Write("\t") == -1 )
return false;
}
if( f.Write("</" + pNode->GetName() + ">") == -1 )
if( f.Write("</") == -1 || f.Write(pNode->GetName()) == -1 || f.Write(">") == -1 )
return false;
if( !pNode->m_childs.empty() )