From f3cefaf043562b85c79a493d8af70e852d9e694f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Feb 2016 20:57:56 +0100 Subject: [PATCH] tag/Tag: move code to MoveItemsFrom() --- src/tag/Tag.hxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx index f1d3d5767..8f0856bc3 100644 --- a/src/tag/Tag.hxx +++ b/src/tag/Tag.hxx @@ -80,9 +80,17 @@ struct Tag { Tag &operator=(Tag &&other) { duration = other.duration; has_playlist = other.has_playlist; + MoveItemsFrom(std::move(other)); + return *this; + } + + /** + * Similar to the move operator, but move only the #TagItem + * array. + */ + void MoveItemsFrom(Tag &&other) { std::swap(items, other.items); std::swap(num_items, other.num_items); - return *this; } /**