aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderAPI.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-07-31 00:34:22 +0200
committerMax Kellermann <max@duempel.org>2013-07-31 00:34:22 +0200
commitcbd38327e7f6948647768227ac4836f64e5ccd51 (patch)
tree03510bbcb68e22a76d261089c97a851a0e6596c3 /src/DecoderAPI.cxx
parent06f898cc1240a29b293de0e97ad95a4fdc971254 (diff)
downloadmpd-cbd38327e7f6948647768227ac4836f64e5ccd51.tar.gz
mpd-cbd38327e7f6948647768227ac4836f64e5ccd51.tar.xz
mpd-cbd38327e7f6948647768227ac4836f64e5ccd51.zip
DecoderAPI: pass rvalue reference to decoder_tag()
Avoid duplicating the tag.
Diffstat (limited to '')
-rw-r--r--src/DecoderAPI.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx
index c7a12c68a..a4bdf37c4 100644
--- a/src/DecoderAPI.cxx
+++ b/src/DecoderAPI.cxx
@@ -471,19 +471,18 @@ decoder_data(struct decoder *decoder,
enum decoder_command
decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
- const Tag *tag)
+ Tag &&tag)
{
G_GNUC_UNUSED const struct decoder_control *dc = decoder->dc;
enum decoder_command cmd;
assert(dc->state == DECODE_STATE_DECODE);
assert(dc->pipe != NULL);
- assert(tag != NULL);
/* save the tag */
delete decoder->decoder_tag;
- decoder->decoder_tag = new Tag(*tag);
+ decoder->decoder_tag = new Tag(tag);
/* check for a new stream tag */
@@ -509,7 +508,7 @@ decoder_tag(G_GNUC_UNUSED struct decoder *decoder, struct input_stream *is,
delete merged;
} else
/* send only the decoder tag */
- cmd = do_send_tag(decoder, *tag);
+ cmd = do_send_tag(decoder, *decoder->decoder_tag);
return cmd;
}