Avoid allocating in ListExtItem when its obviously not necessary.

This commit is contained in:
Sadie Powell 2024-07-07 17:16:48 +01:00
parent 87f66dda48
commit a5f902ec71

View File

@ -311,6 +311,12 @@ public:
if (container->extype != this->extype) if (container->extype != this->extype)
return; return;
if (value.empty())
{
SimpleExtItem<Container>::Unset(container);
return;
}
auto list = new List(); auto list = new List();
irc::spacesepstream stream(value); irc::spacesepstream stream(value);
for (std::string element; stream.GetToken(element); ) for (std::string element; stream.GetToken(element); )