Commit f3cefaf0 authored by Max Kellermann's avatar Max Kellermann

tag/Tag: move code to MoveItemsFrom()

parent b3460f3f
...@@ -80,9 +80,17 @@ struct Tag { ...@@ -80,9 +80,17 @@ struct Tag {
Tag &operator=(Tag &&other) { Tag &operator=(Tag &&other) {
duration = other.duration; duration = other.duration;
has_playlist = other.has_playlist; 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(items, other.items);
std::swap(num_items, other.num_items); std::swap(num_items, other.num_items);
return *this;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment