1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Merge branch 'const_ret_val' into 'master'

Don't use `const` for objects returned by value.

See merge request OpenMW/openmw!1183
This commit is contained in:
Petr Mikheev 2021-09-04 12:41:52 +00:00
commit 76320aae45
5 changed files with 6 additions and 6 deletions

View File

@ -121,7 +121,7 @@ namespace CSMWorld
return SceneUtil::getActorSkeleton(firstPerson, mFemale, beast, werewolf);
}
const std::string ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
const std::string& ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
{
auto it = mParts.find(index);
if (it == mParts.end())
@ -131,7 +131,7 @@ namespace CSMWorld
if (mFemale)
{
// Note: we should use male parts for females as fallback
const std::string femalePart = mRaceData->getFemalePart(index);
const std::string& femalePart = mRaceData->getFemalePart(index);
if (!femalePart.empty())
return femalePart;
}

View File

@ -93,7 +93,7 @@ namespace CSMWorld
/// Returns the skeleton the actor should use for attaching parts to
std::string getSkeleton() const;
/// Retrieves the associated actor part
const std::string getPart(ESM::PartReferenceType index) const;
const std::string& getPart(ESM::PartReferenceType index) const;
/// Checks if the actor has a data dependency
bool hasDependency(const std::string& id) const;

View File

@ -521,7 +521,7 @@ std::string OMW::Engine::loadSettings (Settings::Manager & settings)
throw std::runtime_error ("No default settings file found! Make sure the file \"defaults.bin\" was properly installed.");
// load user settings if they exist
const std::string settingspath = (mCfgMgr.getUserConfigPath() / "settings.cfg").string();
std::string settingspath = (mCfgMgr.getUserConfigPath() / "settings.cfg").string();
if (boost::filesystem::exists(settingspath))
settings.loadUser(settingspath);

View File

@ -27,7 +27,7 @@ namespace DetourNavigator
std::optional<RemovedRecastMeshObject> CachedRecastMeshManager::removeObject(const ObjectId id)
{
const auto object = mImpl.removeObject(id);
auto object = mImpl.removeObject(id);
if (object)
mCached.lock()->reset();
return object;

View File

@ -248,7 +248,7 @@ namespace DetourNavigator
const auto tile = tiles.find(tilePosition);
if (tile == tiles.end())
return std::optional<RemovedRecastMeshObject>();
const auto tileResult = tile->second->removeObject(id);
auto tileResult = tile->second->removeObject(id);
if (tile->second->isEmpty())
{
tiles.erase(tile);