1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 12:39:53 +00:00

string_view& => string_view

fixed ref to temp variable
This commit is contained in:
fteppe 2022-10-14 00:04:36 +02:00 committed by florent.teppe
parent 7da38113be
commit c283ea0ae8
5 changed files with 7 additions and 6 deletions

View File

@ -152,8 +152,8 @@ namespace MWClass
return action;
}
const ESM::RefId& lockedSound = ESM::RefId::stringRefId("LockedChest");
const ESM::RefId& trapActivationSound = ESM::RefId::stringRefId("Disarm Trap Fail");
static const ESM::RefId lockedSound = ESM::RefId::stringRefId("LockedChest");
static const ESM::RefId trapActivationSound = ESM::RefId::stringRefId("Disarm Trap Fail");
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWWorld::InventoryStore& invStore = player.getClass().getInventoryStore(player);

View File

@ -804,7 +804,7 @@ namespace MWGui
return mMessageBoxManager->readPressedButton();
}
std::string_view WindowManager::getGameSettingString(const std::string_view& id, std::string_view default_)
std::string_view WindowManager::getGameSettingString(const std::string_view id, std::string_view default_)
{
const ESM::GameSetting* setting = mStore->get<ESM::GameSetting>().search(id);

View File

@ -283,7 +283,7 @@ namespace MWGui
* @param id Identifier for the GMST setting, e.g. "aName"
* @param default Default value if the GMST setting cannot be used.
*/
std::string_view getGameSettingString(const std::string_view& id, std::string_view default_) override;
std::string_view getGameSettingString(const std::string_view id, std::string_view default_) override;
void processChangedSettings(const Settings::CategorySettingVector& changed) override;

View File

@ -19,7 +19,7 @@ namespace ESM
return os;
}
RefId RefId::stringRefId(const std::string_view & id)
RefId RefId::stringRefId(std::string_view id)
{
RefId newRefId;
newRefId.mId = Misc::StringUtils::lowerCase(id);

View File

@ -3,6 +3,7 @@
#include <functional>
#include <iosfwd>
#include <string>
#include <string_view>
namespace ESM
{
@ -19,7 +20,7 @@ namespace ESM
//The 2 following functions are used to move back and forth between string and RefID. Used for hard coded RefIds that are as string in the code.
//For serialization, and display. Using explicit conversions make it very clear where in the code we need to convert from string to RefId and Vice versa.
static RefId stringRefId(const std::string_view& id);
static RefId stringRefId(std::string_view id);
const std::string& getRefIdString() const { return mId; }