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

@@ -310,7 +310,7 @@ MadDecoder::ParseId3(size_t tagsize, Tag *mpd_tag) noexcept
id3_data = stream.this_frame;
mad_stream_skip(&(stream), tagsize);
} else {
allocated.reset(new id3_byte_t[tagsize]);
allocated = std::make_unique<id3_byte_t[]>(tagsize);
memcpy(allocated.get(), stream.this_frame, count);
mad_stream_skip(&(stream), count);