unique_ptr/new to make_unique
The latter is easier to read and is the "correct" thing to do. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
bedcf1cce5
commit
40c6a214e3
@ -121,7 +121,7 @@ std::unique_ptr<Filter>
|
|||||||
convert_filter_new(const AudioFormat in_audio_format,
|
convert_filter_new(const AudioFormat in_audio_format,
|
||||||
const AudioFormat out_audio_format)
|
const AudioFormat out_audio_format)
|
||||||
{
|
{
|
||||||
std::unique_ptr<ConvertFilter> filter(new ConvertFilter(in_audio_format));
|
auto filter = std::make_unique<ConvertFilter>(in_audio_format);
|
||||||
filter->Set(out_audio_format);
|
filter->Set(out_audio_format);
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ TagBuilder::Commit() noexcept
|
|||||||
std::unique_ptr<Tag>
|
std::unique_ptr<Tag>
|
||||||
TagBuilder::CommitNew() noexcept
|
TagBuilder::CommitNew() noexcept
|
||||||
{
|
{
|
||||||
std::unique_ptr<Tag> tag(new Tag());
|
auto tag = std::make_unique<Tag>();
|
||||||
Commit(*tag);
|
Commit(*tag);
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user