optimize
This commit is contained in:
parent
5957e75924
commit
cbb4b4b318
|
|
@ -100,15 +100,16 @@ namespace easy2d
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
static wchar_t temp_buffer[1024 * 3 + 1];
|
||||||
|
|
||||||
size_t len = ::_vscwprintf(format, args) + 1;
|
size_t len = ::_vscwprintf(format, args) + 1;
|
||||||
wchar_t* buffer = new wchar_t[len];
|
::_vsnwprintf_s(temp_buffer, len, len, format, args);
|
||||||
::_vsnwprintf_s(buffer, len, len, format, args);
|
|
||||||
|
|
||||||
std::wstringstream ss;
|
std::wstringstream ss;
|
||||||
if (prompt)
|
if (prompt)
|
||||||
ss << OutPrefix << prompt << buffer;
|
ss << OutPrefix << prompt << temp_buffer;
|
||||||
else
|
else
|
||||||
ss << OutPrefix << buffer;
|
ss << OutPrefix << temp_buffer;
|
||||||
|
|
||||||
if (endl)
|
if (endl)
|
||||||
ss << L"\r\n";
|
ss << L"\r\n";
|
||||||
|
|
@ -116,8 +117,6 @@ namespace easy2d
|
||||||
std::wstring output = ss.str();
|
std::wstring output = ss.str();
|
||||||
os << color << output;
|
os << color << output;
|
||||||
::OutputDebugStringW(output.c_str());
|
::OutputDebugStringW(output.c_str());
|
||||||
|
|
||||||
delete[] buffer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue