mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Use emplace instead of find-assign
This commit is contained in:
parent
5bce3cbc68
commit
a567111400
@ -244,10 +244,8 @@ namespace NifOsg
|
||||
osg::ref_ptr<NifOsg::KeyframeController> callback(new NifOsg::KeyframeController(key->data.getPtr()));
|
||||
callback->setFunction(std::shared_ptr<NifOsg::ControllerFunction>(new NifOsg::ControllerFunction(key)));
|
||||
|
||||
if (target.mKeyframeControllers.find(strdata->string) != target.mKeyframeControllers.end())
|
||||
if (!target.mKeyframeControllers.emplace(strdata->string, callback).second)
|
||||
Log(Debug::Verbose) << "Controller " << strdata->string << " present more than once in " << nif->getFilename() << ", ignoring later version";
|
||||
else
|
||||
target.mKeyframeControllers[strdata->string] = callback;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,10 +61,7 @@ namespace SceneUtil
|
||||
{
|
||||
// Take transformation for first found node in file
|
||||
const std::string nodeName = Misc::StringUtils::lowerCase(trans.getName());
|
||||
if (mMap.find(nodeName) == mMap.end())
|
||||
{
|
||||
mMap[nodeName] = &trans;
|
||||
}
|
||||
mMap.emplace(nodeName, &trans);
|
||||
|
||||
traverse(trans);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user