mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 08:12:53 +01:00
Avoid constructing temporary string object
This commit is contained in:
@@ -162,7 +162,7 @@ public:
|
||||
int32_t ooIndex = 0;
|
||||
for (const ScenarioOverride& scenarioOverride : _scenarioOverrides)
|
||||
{
|
||||
if (String::IEquals(scenarioOverride.filename.c_str(), scenarioFilename))
|
||||
if (String::IEquals(scenarioOverride.filename, scenarioFilename))
|
||||
{
|
||||
if (scenarioOverride.strings[index].empty())
|
||||
{
|
||||
|
||||
@@ -2113,7 +2113,7 @@ std::string NetworkBase::MakePlayerNameUnique(const std::string& name)
|
||||
// Check if there is already a player with this name in the server
|
||||
for (const auto& player : player_list)
|
||||
{
|
||||
if (String::IEquals(player->Name.c_str(), new_name.c_str()))
|
||||
if (String::IEquals(player->Name, new_name))
|
||||
{
|
||||
unique = false;
|
||||
break;
|
||||
|
||||
@@ -186,7 +186,7 @@ const NetworkUser* NetworkUserManager::GetUserByName(const std::string& name) co
|
||||
for (const auto& kvp : _usersByHash)
|
||||
{
|
||||
const auto& networkUser = kvp.second;
|
||||
if (String::IEquals(name.c_str(), networkUser->Name.c_str()))
|
||||
if (String::IEquals(name, networkUser->Name))
|
||||
{
|
||||
return networkUser.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user