mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 11:39:42 +00:00
Use ESM::RefId as key for ScriptContext::mLocals
This commit is contained in:
parent
3975003778
commit
7daef583cb
2 changed files with 4 additions and 4 deletions
|
@ -85,7 +85,7 @@ std::pair<char, bool> CSMWorld::ScriptContext::getMemberType(const std::string&
|
|||
if (index == -1)
|
||||
return std::make_pair(' ', false);
|
||||
|
||||
std::map<std::string, Compiler::Locals>::iterator iter = mLocals.find(id2.getRefIdString());
|
||||
auto iter = mLocals.find(id2);
|
||||
|
||||
if (iter == mLocals.end())
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ std::pair<char, bool> CSMWorld::ScriptContext::getMemberType(const std::string&
|
|||
Compiler::Scanner scanner(errorHandler, stream, getExtensions());
|
||||
scanner.scan(parser);
|
||||
|
||||
iter = mLocals.insert(std::make_pair(id2.getRefIdString(), locals)).first;
|
||||
iter = mLocals.emplace(id2, std::move(locals)).first;
|
||||
}
|
||||
|
||||
return std::make_pair(iter->second.getType(Misc::StringUtils::lowerCase(name)), reference);
|
||||
|
@ -131,7 +131,7 @@ void CSMWorld::ScriptContext::clear()
|
|||
|
||||
bool CSMWorld::ScriptContext::clearLocals(const std::string& script)
|
||||
{
|
||||
std::map<std::string, Compiler::Locals>::iterator iter = mLocals.find(script);
|
||||
const auto iter = mLocals.find(script);
|
||||
|
||||
if (iter != mLocals.end())
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace CSMWorld
|
|||
const Data& mData;
|
||||
mutable std::vector<ESM::RefId> mIds;
|
||||
mutable bool mIdsUpdated;
|
||||
mutable std::map<std::string, Compiler::Locals, Misc::StringUtils::CiComp> mLocals;
|
||||
mutable std::map<ESM::RefId, Compiler::Locals, std::less<>> mLocals;
|
||||
|
||||
public:
|
||||
ScriptContext(const Data& data);
|
||||
|
|
Loading…
Reference in a new issue