mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
Usage of emplace[_back]() as per cuavas
This commit is contained in:
parent
749e182a80
commit
a21f23357a
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user