Optimized String usage
It will no longer initialize the buffer if not necessary Former-commit-id: b8c910268ed3db6affb8f88b45d043d1dc021aa7
This commit is contained in:
@@ -139,8 +139,7 @@ bool NzUberShaderPreprocessor::SetShaderFromFile(nzShaderStage stage, const NzSt
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user