mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 22:36:39 +00:00
Avoid unnecessary copies
This commit is contained in:
parent
0b5f10e41b
commit
3877d227f4
1 changed files with 3 additions and 4 deletions
|
@ -32,15 +32,14 @@ namespace ESM
|
||||||
std::map<std::pair<std::string, bool>, int> ownerMap;
|
std::map<std::pair<std::string, bool>, int> ownerMap;
|
||||||
while (esm.isNextSub("FNAM") || esm.isNextSub("ONAM"))
|
while (esm.isNextSub("FNAM") || esm.isNextSub("ONAM"))
|
||||||
{
|
{
|
||||||
std::string subname = esm.retSubName().toString();
|
const bool isFaction = (esm.retSubName() == "FNAM");
|
||||||
std::string owner = esm.getHString();
|
std::string owner = esm.getHString();
|
||||||
bool isFaction = (subname == "FNAM");
|
|
||||||
int count;
|
int count;
|
||||||
esm.getHNT(count, "COUN");
|
esm.getHNT(count, "COUN");
|
||||||
ownerMap.insert(std::make_pair(std::make_pair(owner, isFaction), count));
|
ownerMap.emplace(std::make_pair(std::move(owner), isFaction), count);
|
||||||
}
|
}
|
||||||
|
|
||||||
mStolenItems[itemid] = ownerMap;
|
mStolenItems.insert_or_assign(std::move(itemid), std::move(ownerMap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue