use auto with make_unique

C arrays can be used with make_unique in C++17.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-11-11 00:47:45 -08:00
parent 061dd2dfef
commit 31aa6d0c4f
8 changed files with 10 additions and 11 deletions

View File

@@ -137,7 +137,7 @@ SidplayGlobal::SidplayGlobal(const ConfigBlock &block)
const auto kernal_path = block.GetPath("kernal");
if (!kernal_path.IsNull())
{
kernal.reset(new uint8_t[rom_size]);
kernal = std::make_unique<uint8_t[]>(rom_size);
loadRom(kernal_path, kernal.get());
}
@@ -145,7 +145,7 @@ SidplayGlobal::SidplayGlobal(const ConfigBlock &block)
const auto basic_path = block.GetPath("basic");
if (!basic_path.IsNull())
{
basic.reset(new uint8_t[rom_size]);
basic = std::make_unique<uint8_t[]>(rom_size);
loadRom(basic_path, basic.get());
}
#endif