tag/Builder: use std::swap() in move operator
This way, we save the overhead for acquiring the tag_pool_lock.
This commit is contained in:
parent
551c941b5a
commit
96875921b7
@ -78,11 +78,14 @@ TagBuilder::operator=(const TagBuilder &other) noexcept
|
||||
TagBuilder &
|
||||
TagBuilder::operator=(TagBuilder &&other) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
|
||||
duration = other.duration;
|
||||
has_playlist = other.has_playlist;
|
||||
|
||||
RemoveAll();
|
||||
items = std::move(other.items);
|
||||
/* swap the two TagItem lists so we don't need to touch the
|
||||
tag pool just yet */
|
||||
swap(items, other.items);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user