Tag: skip tag pool lock if there are no items

This commit is contained in:
gd 2022-11-01 15:37:54 +02:00
parent 0efbd4df8b
commit ab687481cc

View File

@ -29,15 +29,16 @@ Tag::Clear() noexcept
duration = SignedSongTime::Negative();
has_playlist = false;
{
if (num_items > 0) {
assert(items != nullptr);
const std::scoped_lock<Mutex> protect(tag_pool_lock);
for (unsigned i = 0; i < num_items; ++i)
tag_pool_put_item(items[i]);
num_items = 0;
}
delete[] items;
items = nullptr;
num_items = 0;
}
Tag::Tag(const Tag &other) noexcept