1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 22:15:34 +00:00

Move local variables in components

This commit is contained in:
Andrei Kortunov 2024-01-19 16:01:48 +04:00
parent 6ead5f9321
commit 87c9f395f1
13 changed files with 16 additions and 16 deletions

View file

@ -76,7 +76,7 @@ namespace Bsa
fail("Corrupted BSA");
}
mFolders[dirHash][{ nameHash, extHash }] = file;
mFolders[dirHash][{ nameHash, extHash }] = std::move(file);
FileStruct 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)
{
*iter = settingLine;
*iter = std::move(settingLine);
break;
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -85,7 +85,7 @@ namespace LuaUtil
auto initializer = [](sol::table hiddenData) {
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);
}

View file

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

View file

@ -21,7 +21,7 @@ namespace LuaUi
Log(Debug::Warning) << "A script settings page has an empty name";
if (!element.get())
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

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

View file

@ -77,7 +77,7 @@ void Settings::SettingsFileParser::loadSettingsFile(
Misc::StringUtils::trim(value);
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)
fail(std::string("duplicate setting: [" + currentCategory + "] " + setting));
}