From 5abe4ce8a05073410ae952c167ec3ec32475cfa5 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Fri, 23 Sep 2022 10:10:59 -0400 Subject: [PATCH] Use "make_unique" instead of manually allocating and then creating a unique pointer --- src/CalcViewModel/Common/LocalizationStringUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CalcViewModel/Common/LocalizationStringUtil.h b/src/CalcViewModel/Common/LocalizationStringUtil.h index 33aa482d..d7e08032 100644 --- a/src/CalcViewModel/Common/LocalizationStringUtil.h +++ b/src/CalcViewModel/Common/LocalizationStringUtil.h @@ -16,7 +16,7 @@ namespace CalculatorApp::ViewModel { std::wstring returnString = L""; const UINT32 length = 1024; - std::unique_ptr spBuffer = std::unique_ptr(new wchar_t[length]); + std::unique_ptr spBuffer = std::make_unique(length); va_list args = NULL; va_start(args, pMessage); DWORD fmtReturnVal = FormatMessage(FORMAT_MESSAGE_FROM_STRING, pMessage->Data(), 0, 0, spBuffer.get(), length, &args);