Optimized String usage

It will no longer initialize the buffer if not necessary


Former-commit-id: b8c910268ed3db6affb8f88b45d043d1dc021aa7
This commit is contained in:
Lynix
2014-03-15 00:26:29 +01:00
parent 268d3ae86d
commit 970c0c8ef8
5 changed files with 9 additions and 13 deletions

View File

@@ -238,8 +238,7 @@ bool NzLuaInstance::ExecuteFromFile(const NzString& filePath)
unsigned int length = static_cast<unsigned int>(file.GetSize());
NzString source;
source.Resize(length);
NzString source(length, '\0');
if (file.Read(&source[0], length) != length)
{