1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 16:15:33 +00:00

Merge branch 'move_components' into 'master'

Move local variables in components

See merge request OpenMW/openmw!3790
This commit is contained in:
psi29a 2024-01-20 15:53:07 +00:00
commit 0ad5829e5d
13 changed files with 16 additions and 16 deletions

View file

@ -76,7 +76,7 @@ namespace Bsa
fail("Corrupted BSA"); fail("Corrupted BSA");
} }
mFolders[dirHash][{ nameHash, extHash }] = file; mFolders[dirHash][{ nameHash, extHash }] = std::move(file);
FileStruct fileStruct{}; FileStruct fileStruct{};
mFiles.push_back(fileStruct); mFiles.push_back(fileStruct);

View file

@ -371,7 +371,7 @@ bool Config::GameSettings::writeFileWithComments(QFile& file)
{ {
if ((keyMatch.captured(1) + "=" + keyMatch.captured(2)) == keyVal) if ((keyMatch.captured(1) + "=" + keyMatch.captured(2)) == keyVal)
{ {
*iter = settingLine; *iter = std::move(settingLine);
break; break;
} }
} }

View file

@ -601,7 +601,7 @@ namespace DetourNavigator
if (mSettings.get().mEnableRecastMeshFileNameRevision) if (mSettings.get().mEnableRecastMeshFileNameRevision)
recastMeshRevision = revision; recastMeshRevision = revision;
if (mSettings.get().mEnableNavMeshFileNameRevision) if (mSettings.get().mEnableNavMeshFileNameRevision)
navMeshRevision = revision; navMeshRevision = std::move(revision);
} }
if (recastMesh && mSettings.get().mEnableWriteRecastMeshToFile) if (recastMesh && mSettings.get().mEnableWriteRecastMeshToFile)
writeToFile(*recastMesh, writeToFile(*recastMesh,

View file

@ -74,7 +74,7 @@ namespace ESM
esm.getHNT(multiplier, "MULT"); esm.getHNT(multiplier, "MULT");
params.emplace_back(rand, multiplier); params.emplace_back(rand, multiplier);
} }
mPermanentMagicEffectMagnitudes[id] = params; mPermanentMagicEffectMagnitudes[id] = std::move(params);
} }
while (esm.isNextSub("EQUI")) while (esm.isNextSub("EQUI"))

View file

@ -33,7 +33,7 @@ namespace ESM
state.mPurgedEffects.insert(index); state.mPurgedEffects.insert(index);
} }
mSpellParams[id] = state; mSpellParams[id] = std::move(state);
mSpells.emplace_back(id); mSpells.emplace_back(id);
} }
} }
@ -69,7 +69,7 @@ namespace ESM
esm.getHNT(info.mMagnitude, "MAGN"); esm.getHNT(info.mMagnitude, "MAGN");
permEffectList.push_back(info); permEffectList.push_back(info);
} }
mPermanentSpellEffects[spellId] = permEffectList; mPermanentSpellEffects[spellId] = std::move(permEffectList);
} }
// Obsolete // Obsolete

View file

@ -50,7 +50,7 @@ void ESM4::Furniture::load(ESM4::Reader& reader)
reader.getLocalizedString(name); reader.getLocalizedString(name);
// FIXME: subsequent FULL subrecords name object combinations (FO4) // FIXME: subsequent FULL subrecords name object combinations (FO4)
if (mFullName.empty()) if (mFullName.empty())
mFullName = name; mFullName = std::move(name);
break; break;
} }
case ESM4::SUB_MODL: case ESM4::SUB_MODL:

View file

@ -586,7 +586,7 @@ namespace ESMTerrain
Misc::StringUtils::replaceLast(texture_, ".", mNormalHeightMapPattern + "."); Misc::StringUtils::replaceLast(texture_, ".", mNormalHeightMapPattern + ".");
if (mVFS->exists(texture_)) if (mVFS->exists(texture_))
{ {
info.mNormalMap = texture_; info.mNormalMap = std::move(texture_);
info.mParallax = true; info.mParallax = true;
} }
else else
@ -594,7 +594,7 @@ namespace ESMTerrain
texture_ = texture; texture_ = texture;
Misc::StringUtils::replaceLast(texture_, ".", mNormalMapPattern + "."); Misc::StringUtils::replaceLast(texture_, ".", mNormalMapPattern + ".");
if (mVFS->exists(texture_)) if (mVFS->exists(texture_))
info.mNormalMap = texture_; info.mNormalMap = std::move(texture_);
} }
} }
@ -604,7 +604,7 @@ namespace ESMTerrain
Misc::StringUtils::replaceLast(texture_, ".", mSpecularMapPattern + "."); Misc::StringUtils::replaceLast(texture_, ".", mSpecularMapPattern + ".");
if (mVFS->exists(texture_)) if (mVFS->exists(texture_))
{ {
info.mDiffuseMap = texture_; info.mDiffuseMap = std::move(texture_);
info.mSpecular = true; info.mSpecular = true;
} }
} }

View file

@ -309,7 +309,7 @@ namespace Files
tempPath /= str.substr(pos + 1, str.length() - pos); tempPath /= str.substr(pos + 1, str.length() - pos);
} }
path = tempPath; path = std::move(tempPath);
} }
else else
{ {

View file

@ -85,7 +85,7 @@ namespace LuaUtil
auto initializer = [](sol::table hiddenData) { auto initializer = [](sol::table hiddenData) {
ScriptId id = hiddenData[ScriptsContainer::sScriptIdKey]; ScriptId id = hiddenData[ScriptsContainer::sScriptIdKey];
return AsyncPackageId{ id.mContainer, id.mIndex, hiddenData }; return AsyncPackageId{ id.mContainer, id.mIndex, std::move(hiddenData) };
}; };
return sol::make_object(lua, initializer); return sol::make_object(lua, initializer);
} }

View file

@ -38,7 +38,7 @@ namespace LuaUi
if (typeField != sol::nil && templateType != type) if (typeField != sol::nil && templateType != type)
throw std::logic_error(std::string("Template layout type ") + type throw std::logic_error(std::string("Template layout type ") + type
+ std::string(" doesn't match template type ") + templateType); + std::string(" doesn't match template type ") + templateType);
type = templateType; type = std::move(templateType);
} }
return type; return type;
} }

View file

@ -21,7 +21,7 @@ namespace LuaUi
Log(Debug::Warning) << "A script settings page has an empty name"; Log(Debug::Warning) << "A script settings page has an empty name";
if (!element.get()) if (!element.get())
Log(Debug::Warning) << "A script settings page has no UI element assigned"; Log(Debug::Warning) << "A script settings page has no UI element assigned";
return { std::move(name), std::move(searchHints), element }; return { std::move(name), std::move(searchHints), std::move(element) };
} }
} }

View file

@ -673,7 +673,7 @@ namespace Nif
assert(r != nullptr); assert(r != nullptr);
assert(r->recType != RC_MISSING); assert(r->recType != RC_MISSING);
r->recName = rec; r->recName = std::move(rec);
r->recIndex = i; r->recIndex = i;
r->read(&nif); r->read(&nif);
mRecords[i] = std::move(r); mRecords[i] = std::move(r);

View file

@ -77,7 +77,7 @@ void Settings::SettingsFileParser::loadSettingsFile(
Misc::StringUtils::trim(value); Misc::StringUtils::trim(value);
if (overrideExisting) if (overrideExisting)
settings[std::make_pair(currentCategory, setting)] = value; settings[std::make_pair(currentCategory, setting)] = std::move(value);
else if (settings.insert(std::make_pair(std::make_pair(currentCategory, setting), value)).second == false) else if (settings.insert(std::make_pair(std::make_pair(currentCategory, setting), value)).second == false)
fail(std::string("duplicate setting: [" + currentCategory + "] " + setting)); fail(std::string("duplicate setting: [" + currentCategory + "] " + setting));
} }