diff --git a/apps/opencs/model/tools/topicinfocheck.cpp b/apps/opencs/model/tools/topicinfocheck.cpp index fe9bc991d4..74643a46ee 100644 --- a/apps/opencs/model/tools/topicinfocheck.cpp +++ b/apps/opencs/model/tools/topicinfocheck.cpp @@ -395,12 +395,12 @@ bool CSMTools::TopicInfoCheckStage::verifyId(const std::string& name, const CSMW if (index == -1) { - messages.add(id, T::getRecordType() + " '" + name + "' does not exist", "", CSMDoc::Message::Severity_Error); + messages.add(id, std::string(T::getRecordType()) + " '" + name + "' does not exist", "", CSMDoc::Message::Severity_Error); return false; } else if (collection.getRecord(index).isDeleted()) { - messages.add(id, "Deleted " + T::getRecordType() + " record '" + name + "' is being referenced", "", CSMDoc::Message::Severity_Error); + messages.add(id, "Deleted " + std::string(T::getRecordType()) + " record '" + name + "' is being referenced", "", CSMDoc::Message::Severity_Error); return false; } diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 58f215932e..112f56abfc 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -728,8 +728,8 @@ int MWWorld::ContainerStore::getType (const ConstPtr& ptr) if (ptr.getType()==ESM::Weapon::sRecordId) return Type_Weapon; - throw std::runtime_error ( - "Object '" + ptr.getCellRef().getRefId() + "' of type " + ptr.getTypeDescription() + " can not be placed into a container"); + throw std::runtime_error("Object '" + ptr.getCellRef().getRefId() + "' of type " + + std::string(ptr.getTypeDescription()) + " can not be placed into a container"); } MWWorld::Ptr MWWorld::ContainerStore::findReplacement(const std::string& id) diff --git a/apps/openmw/mwworld/livecellref.hpp b/apps/openmw/mwworld/livecellref.hpp index af0f84dc8d..48e237bce4 100644 --- a/apps/openmw/mwworld/livecellref.hpp +++ b/apps/openmw/mwworld/livecellref.hpp @@ -41,7 +41,7 @@ namespace MWWorld virtual void save (ESM::ObjectState& state) const = 0; ///< Save LiveCellRef state into \a state. - virtual std::string getTypeDescription() const { return ""; } + virtual std::string_view getTypeDescription() const = 0; protected: @@ -95,7 +95,7 @@ namespace MWWorld void save (ESM::ObjectState& state) const override; ///< Save LiveCellRef state into \a state. - std::string getTypeDescription() const override { return X::getRecordType(); } + std::string_view getTypeDescription() const override { return X::getRecordType(); } static bool checkState (const ESM::ObjectState& state); ///< Check if state is valid and report errors. diff --git a/apps/openmw/mwworld/ptr.hpp b/apps/openmw/mwworld/ptr.hpp index 6813b7d124..611eeefe16 100644 --- a/apps/openmw/mwworld/ptr.hpp +++ b/apps/openmw/mwworld/ptr.hpp @@ -37,7 +37,7 @@ namespace MWWorld unsigned int getType() const; - std::string getTypeDescription() const + std::string_view getTypeDescription() const { return mRef ? mRef->getTypeDescription() : "nullptr"; } @@ -118,7 +118,7 @@ namespace MWWorld unsigned int getType() const; - std::string getTypeDescription() const + std::string_view getTypeDescription() const { return mRef ? mRef->getTypeDescription() : "nullptr"; } diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 718cebd790..963e3b78cd 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -64,8 +64,9 @@ namespace MWWorld const T *ptr = search(index); if (ptr == nullptr) { - const std::string msg = T::getRecordType() + " with index " + std::to_string(index) + " not found"; - throw std::runtime_error(msg); + std::stringstream msg; + msg << T::getRecordType() << " with index " << index << " not found"; + throw std::runtime_error(msg.str()); } return ptr; } @@ -145,8 +146,9 @@ namespace MWWorld const T *ptr = search(id); if (ptr == nullptr) { - const std::string msg = T::getRecordType() + " '" + id + "' not found"; - throw std::runtime_error(msg); + std::stringstream msg; + msg << T::getRecordType() << " '" << id << "' not found"; + throw std::runtime_error(msg.str()); } return ptr; } diff --git a/components/esm/loadacti.hpp b/components/esm/loadacti.hpp index 5b88ad379f..c0cf274ed9 100644 --- a/components/esm/loadacti.hpp +++ b/components/esm/loadacti.hpp @@ -13,7 +13,7 @@ struct Activator { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Activator"; } + static std::string_view getRecordType() { return "Activator"; } unsigned int mRecordFlags; std::string mId, mName, mScript, mModel; diff --git a/components/esm/loadalch.hpp b/components/esm/loadalch.hpp index d573531134..e032464abe 100644 --- a/components/esm/loadalch.hpp +++ b/components/esm/loadalch.hpp @@ -20,7 +20,7 @@ struct Potion static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Potion"; } + static std::string_view getRecordType() { return "Potion"; } struct ALDTstruct { diff --git a/components/esm/loadappa.hpp b/components/esm/loadappa.hpp index fcd9100be4..026a471f5b 100644 --- a/components/esm/loadappa.hpp +++ b/components/esm/loadappa.hpp @@ -17,7 +17,7 @@ struct Apparatus { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Apparatus"; } + static std::string_view getRecordType() { return "Apparatus"; } enum AppaType { diff --git a/components/esm/loadarmo.hpp b/components/esm/loadarmo.hpp index 195230fbf2..f11e3509d5 100644 --- a/components/esm/loadarmo.hpp +++ b/components/esm/loadarmo.hpp @@ -67,7 +67,7 @@ struct Armor { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Armor"; } + static std::string_view getRecordType() { return "Armor"; } enum Type { diff --git a/components/esm/loadbody.hpp b/components/esm/loadbody.hpp index 1be775ffec..145fe4b6f6 100644 --- a/components/esm/loadbody.hpp +++ b/components/esm/loadbody.hpp @@ -13,7 +13,7 @@ struct BodyPart { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "BodyPart"; } + static std::string_view getRecordType() { return "BodyPart"; } enum MeshPart { diff --git a/components/esm/loadbook.hpp b/components/esm/loadbook.hpp index 60b03f7a36..e46bec6272 100644 --- a/components/esm/loadbook.hpp +++ b/components/esm/loadbook.hpp @@ -16,7 +16,7 @@ struct Book { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Book"; } + static std::string_view getRecordType() { return "Book"; } struct BKDTstruct { diff --git a/components/esm/loadbsgn.hpp b/components/esm/loadbsgn.hpp index 806323bf35..a199503a76 100644 --- a/components/esm/loadbsgn.hpp +++ b/components/esm/loadbsgn.hpp @@ -15,7 +15,7 @@ struct BirthSign { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "BirthSign"; } + static std::string_view getRecordType() { return "BirthSign"; } unsigned int mRecordFlags; std::string mId, mName, mDescription, mTexture; diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index 18e929e13b..c2a694b744 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -65,7 +65,7 @@ struct Cell { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Cell"; } + static std::string_view getRecordType() { return "Cell"; } enum Flags { diff --git a/components/esm/loadclas.hpp b/components/esm/loadclas.hpp index 1000879c4c..e1e8b2ff0f 100644 --- a/components/esm/loadclas.hpp +++ b/components/esm/loadclas.hpp @@ -19,7 +19,7 @@ struct Class { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Class"; } + static std::string_view getRecordType() { return "Class"; } enum AutoCalc { diff --git a/components/esm/loadclot.hpp b/components/esm/loadclot.hpp index bbc8449a95..26e82254ab 100644 --- a/components/esm/loadclot.hpp +++ b/components/esm/loadclot.hpp @@ -19,7 +19,7 @@ struct Clothing { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Clothing"; } + static std::string_view getRecordType() { return "Clothing"; } enum Type { diff --git a/components/esm/loadcont.hpp b/components/esm/loadcont.hpp index ade9004214..eac791e3f3 100644 --- a/components/esm/loadcont.hpp +++ b/components/esm/loadcont.hpp @@ -37,7 +37,7 @@ struct Container { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Container"; } + static std::string_view getRecordType() { return "Container"; } enum Flags { diff --git a/components/esm/loadcrea.hpp b/components/esm/loadcrea.hpp index f6b188d96e..9d664d440e 100644 --- a/components/esm/loadcrea.hpp +++ b/components/esm/loadcrea.hpp @@ -23,7 +23,7 @@ struct Creature { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Creature"; } + static std::string_view getRecordType() { return "Creature"; } // Default is 0x48? enum Flags diff --git a/components/esm/loaddial.hpp b/components/esm/loaddial.hpp index b80cbd74c3..7adc8b1cf8 100644 --- a/components/esm/loaddial.hpp +++ b/components/esm/loaddial.hpp @@ -22,7 +22,7 @@ struct Dialogue { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Dialogue"; } + static std::string_view getRecordType() { return "Dialogue"; } enum Type { diff --git a/components/esm/loaddoor.hpp b/components/esm/loaddoor.hpp index 167eda20f5..84dbcbfa56 100644 --- a/components/esm/loaddoor.hpp +++ b/components/esm/loaddoor.hpp @@ -13,7 +13,7 @@ struct Door { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Door"; } + static std::string_view getRecordType() { return "Door"; } unsigned int mRecordFlags; std::string mId, mName, mModel, mScript, mOpenSound, mCloseSound; diff --git a/components/esm/loadench.hpp b/components/esm/loadench.hpp index a4e1e8362c..3f094f754c 100644 --- a/components/esm/loadench.hpp +++ b/components/esm/loadench.hpp @@ -19,7 +19,7 @@ struct Enchantment { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Enchantment"; } + static std::string_view getRecordType() { return "Enchantment"; } enum Type { diff --git a/components/esm/loadfact.hpp b/components/esm/loadfact.hpp index 6a42377901..da01c004e9 100644 --- a/components/esm/loadfact.hpp +++ b/components/esm/loadfact.hpp @@ -32,7 +32,7 @@ struct Faction { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Faction"; } + static std::string_view getRecordType() { return "Faction"; } unsigned int mRecordFlags; std::string mId, mName; diff --git a/components/esm/loadglob.hpp b/components/esm/loadglob.hpp index 9dd58e6c67..7fcbe4b8e6 100644 --- a/components/esm/loadglob.hpp +++ b/components/esm/loadglob.hpp @@ -19,7 +19,7 @@ struct Global { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Global"; } + static std::string_view getRecordType() { return "Global"; } unsigned int mRecordFlags; std::string mId; diff --git a/components/esm/loadgmst.hpp b/components/esm/loadgmst.hpp index 931ee286a4..a3981736f1 100644 --- a/components/esm/loadgmst.hpp +++ b/components/esm/loadgmst.hpp @@ -20,7 +20,7 @@ struct GameSetting { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "GameSetting"; } + static std::string_view getRecordType() { return "GameSetting"; } unsigned int mRecordFlags; std::string mId; diff --git a/components/esm/loadinfo.hpp b/components/esm/loadinfo.hpp index 2fbc782ec9..d68301c91b 100644 --- a/components/esm/loadinfo.hpp +++ b/components/esm/loadinfo.hpp @@ -22,7 +22,7 @@ struct DialInfo { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "DialInfo"; } + static std::string_view getRecordType() { return "DialInfo"; } enum Gender { diff --git a/components/esm/loadingr.hpp b/components/esm/loadingr.hpp index 34e05da2c1..2ee572123d 100644 --- a/components/esm/loadingr.hpp +++ b/components/esm/loadingr.hpp @@ -17,7 +17,7 @@ struct Ingredient { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Ingredient"; } + static std::string_view getRecordType() { return "Ingredient"; } struct IRDTstruct { diff --git a/components/esm/loadland.hpp b/components/esm/loadland.hpp index 9cba41b160..67dd2e76a2 100644 --- a/components/esm/loadland.hpp +++ b/components/esm/loadland.hpp @@ -21,7 +21,7 @@ struct Land { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Land"; } + static std::string_view getRecordType() { return "Land"; } Land(); ~Land(); diff --git a/components/esm/loadlevlist.hpp b/components/esm/loadlevlist.hpp index d3451b70ae..0ebd7a64cb 100644 --- a/components/esm/loadlevlist.hpp +++ b/components/esm/loadlevlist.hpp @@ -48,7 +48,7 @@ struct CreatureLevList: LevelledListBase { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "CreatureLevList"; } + static std::string_view getRecordType() { return "CreatureLevList"; } enum Flags { @@ -68,7 +68,7 @@ struct ItemLevList: LevelledListBase { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "ItemLevList"; } + static std::string_view getRecordType() { return "ItemLevList"; } enum Flags { diff --git a/components/esm/loadligh.hpp b/components/esm/loadligh.hpp index 901fe6ec85..9bd608e4d9 100644 --- a/components/esm/loadligh.hpp +++ b/components/esm/loadligh.hpp @@ -18,7 +18,7 @@ struct Light { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Light"; } + static std::string_view getRecordType() { return "Light"; } enum Flags { diff --git a/components/esm/loadlock.hpp b/components/esm/loadlock.hpp index 9cd40c0d4f..4f8a3575fc 100644 --- a/components/esm/loadlock.hpp +++ b/components/esm/loadlock.hpp @@ -13,7 +13,7 @@ struct Lockpick { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Lockpick"; } + static std::string_view getRecordType() { return "Lockpick"; } struct Data { diff --git a/components/esm/loadltex.hpp b/components/esm/loadltex.hpp index e3e2582462..b2e937c01a 100644 --- a/components/esm/loadltex.hpp +++ b/components/esm/loadltex.hpp @@ -20,7 +20,7 @@ struct LandTexture { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "LandTexture"; } + static std::string_view getRecordType() { return "LandTexture"; } // mId is merely a user friendly name for the texture in the editor. std::string mId, mTexture; diff --git a/components/esm/loadmgef.hpp b/components/esm/loadmgef.hpp index 480478d81e..00cadf99c0 100644 --- a/components/esm/loadmgef.hpp +++ b/components/esm/loadmgef.hpp @@ -14,7 +14,7 @@ struct MagicEffect { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "MagicEffect"; } + static std::string_view getRecordType() { return "MagicEffect"; } unsigned int mRecordFlags; std::string mId; diff --git a/components/esm/loadmisc.hpp b/components/esm/loadmisc.hpp index 72aaa5de3b..a0f46349a8 100644 --- a/components/esm/loadmisc.hpp +++ b/components/esm/loadmisc.hpp @@ -18,7 +18,7 @@ struct Miscellaneous { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Miscellaneous"; } + static std::string_view getRecordType() { return "Miscellaneous"; } struct MCDTstruct { diff --git a/components/esm/loadnpc.hpp b/components/esm/loadnpc.hpp index ba9f415760..f0354cb603 100644 --- a/components/esm/loadnpc.hpp +++ b/components/esm/loadnpc.hpp @@ -24,7 +24,7 @@ struct NPC { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "NPC"; } + static std::string_view getRecordType() { return "NPC"; } // Services enum Services diff --git a/components/esm/loadpgrd.hpp b/components/esm/loadpgrd.hpp index 4e74c9a24d..02ce231fe3 100644 --- a/components/esm/loadpgrd.hpp +++ b/components/esm/loadpgrd.hpp @@ -17,7 +17,7 @@ struct Pathgrid { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Pathgrid"; } + static std::string_view getRecordType() { return "Pathgrid"; } struct DATAstruct { diff --git a/components/esm/loadprob.hpp b/components/esm/loadprob.hpp index 930e31a971..583aa24523 100644 --- a/components/esm/loadprob.hpp +++ b/components/esm/loadprob.hpp @@ -13,7 +13,7 @@ struct Probe { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Probe"; } + static std::string_view getRecordType() { return "Probe"; } struct Data { diff --git a/components/esm/loadrace.hpp b/components/esm/loadrace.hpp index 50fa73ad74..ba42261e73 100644 --- a/components/esm/loadrace.hpp +++ b/components/esm/loadrace.hpp @@ -19,7 +19,7 @@ struct Race { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Race"; } + static std::string_view getRecordType() { return "Race"; } struct SkillBonus { diff --git a/components/esm/loadregn.hpp b/components/esm/loadregn.hpp index 74f6b123ec..64991c9b3a 100644 --- a/components/esm/loadregn.hpp +++ b/components/esm/loadregn.hpp @@ -20,7 +20,7 @@ struct Region { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Region"; } + static std::string_view getRecordType() { return "Region"; } #pragma pack(push) #pragma pack(1) diff --git a/components/esm/loadrepa.hpp b/components/esm/loadrepa.hpp index 312c87b7b4..c3b2a076af 100644 --- a/components/esm/loadrepa.hpp +++ b/components/esm/loadrepa.hpp @@ -13,7 +13,7 @@ struct Repair { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Repair"; } + static std::string_view getRecordType() { return "Repair"; } struct Data { diff --git a/components/esm/loadscpt.hpp b/components/esm/loadscpt.hpp index d518a048ff..f737698184 100644 --- a/components/esm/loadscpt.hpp +++ b/components/esm/loadscpt.hpp @@ -21,7 +21,7 @@ class Script public: static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Script"; } + static std::string_view getRecordType() { return "Script"; } struct SCHDstruct { diff --git a/components/esm/loadskil.hpp b/components/esm/loadskil.hpp index ae44a51045..404ef06692 100644 --- a/components/esm/loadskil.hpp +++ b/components/esm/loadskil.hpp @@ -20,7 +20,7 @@ struct Skill { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Skill"; } + static std::string_view getRecordType() { return "Skill"; } unsigned int mRecordFlags; std::string mId; diff --git a/components/esm/loadsndg.hpp b/components/esm/loadsndg.hpp index 99aae06e0e..565a29b156 100644 --- a/components/esm/loadsndg.hpp +++ b/components/esm/loadsndg.hpp @@ -17,7 +17,7 @@ struct SoundGenerator { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "SoundGenerator"; } + static std::string_view getRecordType() { return "SoundGenerator"; } enum Type { diff --git a/components/esm/loadsoun.hpp b/components/esm/loadsoun.hpp index 14f1178650..4149a34b7d 100644 --- a/components/esm/loadsoun.hpp +++ b/components/esm/loadsoun.hpp @@ -18,7 +18,7 @@ struct Sound { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Sound"; } + static std::string_view getRecordType() { return "Sound"; } SOUNstruct mData; unsigned int mRecordFlags; diff --git a/components/esm/loadspel.hpp b/components/esm/loadspel.hpp index ef74c2c312..6a2d02d286 100644 --- a/components/esm/loadspel.hpp +++ b/components/esm/loadspel.hpp @@ -15,7 +15,7 @@ struct Spell { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Spell"; } + static std::string_view getRecordType() { return "Spell"; } enum SpellType { diff --git a/components/esm/loadsscr.hpp b/components/esm/loadsscr.hpp index 3e84027076..277c4eb731 100644 --- a/components/esm/loadsscr.hpp +++ b/components/esm/loadsscr.hpp @@ -21,7 +21,7 @@ struct StartScript { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "StartScript"; } + static std::string_view getRecordType() { return "StartScript"; } std::string mData; unsigned int mRecordFlags; diff --git a/components/esm/loadstat.hpp b/components/esm/loadstat.hpp index 038fb9f52b..26d8fda3a8 100644 --- a/components/esm/loadstat.hpp +++ b/components/esm/loadstat.hpp @@ -24,7 +24,7 @@ struct Static { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Static"; } + static std::string_view getRecordType() { return "Static"; } unsigned int mRecordFlags; std::string mId, mModel; diff --git a/components/esm/loadweap.hpp b/components/esm/loadweap.hpp index 8d1591854b..98ba57b8b8 100644 --- a/components/esm/loadweap.hpp +++ b/components/esm/loadweap.hpp @@ -19,7 +19,7 @@ struct Weapon { static unsigned int sRecordId; /// Return a string descriptor for this record type. Currently used for debugging / error logs only. - static std::string getRecordType() { return "Weapon"; } + static std::string_view getRecordType() { return "Weapon"; } enum Type {