Usage of emplace[_back]() as per cuavas

This commit is contained in:
Nathan Woods 2016-06-30 06:03:54 -04:00
parent 749e182a80
commit a21f23357a

View File

@ -361,11 +361,11 @@ void menu::item_append(std::string &&text, std::string &&subtext, UINT32 flags,
auto index = item.size(); auto index = item.size();
if (!item.empty()) if (!item.empty())
{ {
item.insert(item.end() - 1, pitem); item.emplace(item.end() - 1, std::move(pitem));
--index; --index;
} }
else else
item.push_back(pitem); item.emplace_back(std::move(pitem));
// update the selection if we need to // update the selection if we need to
if (resetpos == index || (resetref != nullptr && resetref == ref)) if (resetpos == index || (resetref != nullptr && resetref == ref))