Commit 96875921 authored by Max Kellermann's avatar Max Kellermann

tag/Builder: use std::swap() in move operator

This way, we save the overhead for acquiring the tag_pool_lock.
parent 551c941b
...@@ -78,11 +78,14 @@ TagBuilder::operator=(const TagBuilder &other) noexcept ...@@ -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;
} }
......
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