tag/Tag: move code to MoveItemsFrom()
This commit is contained in:
parent
b3460f3f54
commit
f3cefaf043
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user