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:
Max Kellermann 2021-08-05 14:27:30 +02:00
parent 551c941b5a
commit 96875921b7

View File

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