mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 10:36:50 -07:00
Use "make_unique" instead of manually allocating and then creating a unique pointer (#1899)
This commit is contained in:
parent
d9a32fdf4f
commit
d9ef114dbe
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ namespace CalculatorApp::ViewModel
|
|||
{
|
||||
std::wstring returnString = L"";
|
||||
const UINT32 length = 1024;
|
||||
std::unique_ptr<wchar_t[]> spBuffer = std::unique_ptr<wchar_t[]>(new wchar_t[length]);
|
||||
std::unique_ptr<wchar_t[]> spBuffer = std::make_unique<wchar_t[]>(length);
|
||||
va_list args = NULL;
|
||||
va_start(args, pMessage);
|
||||
DWORD fmtReturnVal = FormatMessage(FORMAT_MESSAGE_FROM_STRING, pMessage->Data(), 0, 0, spBuffer.get(), length, &args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue