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 &
|
||||||
TagBuilder::operator=(TagBuilder &&other) noexcept
|
TagBuilder::operator=(TagBuilder &&other) noexcept
|
||||||
{
|
{
|
||||||
|
using std::swap;
|
||||||
|
|
||||||
duration = other.duration;
|
duration = other.duration;
|
||||||
has_playlist = other.has_playlist;
|
has_playlist = other.has_playlist;
|
||||||
|
|
||||||
RemoveAll();
|
/* swap the two TagItem lists so we don't need to touch the
|
||||||
items = std::move(other.items);
|
tag pool just yet */
|
||||||
|
swap(items, other.items);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user