App: [skip ci] lgtm: Large object passed by value

This parameter of type pair<const basic_string<char, char_traits<char>, allocator<char>>, Metadata> is 672 bytes - consider passing a const pointer/reference instead.
This commit is contained in:
wmayer
2022-03-20 16:42:48 +01:00
parent 166e4a3e1e
commit 32e9984751

View File

@@ -345,7 +345,7 @@ void App::Metadata::addGenericMetadata(const std::string& tag, const Meta::Gener
void App::Metadata::removeContentItem(const std::string& tag, const std::string& itemName)
{
auto tagRange = _content.equal_range(tag);
auto foundItem = std::find_if(tagRange.first, tagRange.second, [&itemName](auto check) -> bool { return itemName == check.second.name(); });
auto foundItem = std::find_if(tagRange.first, tagRange.second, [&itemName](const auto& check) -> bool { return itemName == check.second.name(); });
if (foundItem != tagRange.second)
_content.erase(foundItem);
}