From 40c6a214e3b363b5214e660258e3456babfaefa0 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 20 Aug 2021 23:03:22 -0700 Subject: [PATCH] unique_ptr/new to make_unique The latter is easier to read and is the "correct" thing to do. Signed-off-by: Rosen Penev --- src/filter/plugins/ConvertFilterPlugin.cxx | 2 +- src/tag/Builder.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filter/plugins/ConvertFilterPlugin.cxx b/src/filter/plugins/ConvertFilterPlugin.cxx index 5b7c96c74..5dcca8f99 100644 --- a/src/filter/plugins/ConvertFilterPlugin.cxx +++ b/src/filter/plugins/ConvertFilterPlugin.cxx @@ -121,7 +121,7 @@ std::unique_ptr convert_filter_new(const AudioFormat in_audio_format, const AudioFormat out_audio_format) { - std::unique_ptr filter(new ConvertFilter(in_audio_format)); + auto filter = std::make_unique(in_audio_format); filter->Set(out_audio_format); return filter; } diff --git a/src/tag/Builder.cxx b/src/tag/Builder.cxx index b2887c903..3dbb5a383 100644 --- a/src/tag/Builder.cxx +++ b/src/tag/Builder.cxx @@ -158,7 +158,7 @@ TagBuilder::Commit() noexcept std::unique_ptr TagBuilder::CommitNew() noexcept { - std::unique_ptr tag(new Tag()); + auto tag = std::make_unique(); Commit(*tag); return tag; }