Commit 5703a48a authored by cutealien's avatar cutealien

Preallocate string in CXMLWriter::writeText to speedup xml-writing somewhat.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4175 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8eb53988
...@@ -205,7 +205,8 @@ void CXMLWriter::writeText(const wchar_t* text) ...@@ -205,7 +205,8 @@ void CXMLWriter::writeText(const wchar_t* text)
if (!File || !text) if (!File || !text)
return; return;
core::stringw s; core::stringw s(text);
s = L""; // passing text and then resetting it is a (little ackward) way to reserve memory for the string to avoid lots of reallocations below.
const wchar_t* p = text; const wchar_t* p = text;
while(*p) while(*p)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment