tag/Tag: move code to MoveItemsFrom()

This commit is contained in:
Max Kellermann 2016-02-23 20:57:56 +01:00
parent b3460f3f54
commit f3cefaf043

View File

@ -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;
}
/**