1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Use string_view in ParseSourceGame lookup helper

This commit is contained in:
ζeh Matt
2025-04-21 02:43:21 +03:00
parent a22c041379
commit 0b581281c5

View File

@@ -227,9 +227,9 @@ namespace OpenRCT2::ObjectFactory
static std::unique_ptr<Object> CreateObjectFromJson(
IObjectRepository& objectRepository, json_t& jRoot, const IFileDataRetriever* fileRetriever, bool loadImageTable);
static ObjectSourceGame ParseSourceGame(const std::string& s)
static ObjectSourceGame ParseSourceGame(const std::string_view s)
{
static const std::unordered_map<std::string, ObjectSourceGame> LookupTable{
static const std::unordered_map<std::string_view, ObjectSourceGame> LookupTable{
{ "rct1", ObjectSourceGame::RCT1 },
{ "rct1aa", ObjectSourceGame::AddedAttractions },
{ "rct1ll", ObjectSourceGame::LoopyLandscapes },