From 0b774df3756d73c69de4c8cb553c133f7c5bd99e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 26 Aug 2021 13:31:53 -0700 Subject: [PATCH] prevent use after move These should be equivalent anyway. Signed-off-by: Rosen Penev --- src/db/plugins/upnp/Directory.cxx | 2 +- src/decoder/Control.cxx | 2 +- src/playlist/cue/CueParser.cxx | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/db/plugins/upnp/Directory.cxx b/src/db/plugins/upnp/Directory.cxx index f3f64c154..59dfba0e6 100644 --- a/src/db/plugins/upnp/Directory.cxx +++ b/src/db/plugins/upnp/Directory.cxx @@ -192,7 +192,7 @@ protected: if (tag_type == TAG_TITLE) object.name = TitleToPathSegment(std::move(value)); - value.clear(); + value = {}; tag_type = TAG_NUM_OF_ITEM_TYPES; return; } diff --git a/src/decoder/Control.cxx b/src/decoder/Control.cxx index c3e6a52f3..a0516a933 100644 --- a/src/decoder/Control.cxx +++ b/src/decoder/Control.cxx @@ -170,5 +170,5 @@ void DecoderControl::CycleMixRamp() noexcept { previous_mix_ramp = std::move(mix_ramp); - mix_ramp.Clear(); + mix_ramp = {}; } diff --git a/src/playlist/cue/CueParser.cxx b/src/playlist/cue/CueParser.cxx index cb7d2ee19..6e12e77ff 100644 --- a/src/playlist/cue/CueParser.cxx +++ b/src/playlist/cue/CueParser.cxx @@ -171,7 +171,6 @@ CueParser::Commit() noexcept finished = std::move(previous); previous = std::move(current); - current.reset(); } void @@ -302,10 +301,7 @@ CueParser::Get() noexcept assert(current == nullptr); finished = std::move(previous); - previous.reset(); } - auto result = std::move(finished); - finished.reset(); - return result; + return std::move(finished); }