mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Use compare method instead of strcmp on std::string
This commit is contained in:
parent
e97b4e53b2
commit
0b4eb06dd2
@ -25,7 +25,7 @@ bool s_bBasePaksInitialized = false;
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool MOD_LevelHasChanged(const string& svLevelName)
|
bool MOD_LevelHasChanged(const string& svLevelName)
|
||||||
{
|
{
|
||||||
return (strcmp(svLevelName.c_str(), g_svLevelName.c_str()) != 0);
|
return (g_svLevelName.compare(svLevelName) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -93,11 +93,11 @@ void CNetAdr2::SetIPAndPort(string svInAdr)
|
|||||||
void CNetAdr2::SetIPAndPort(string svInAdr, string svInPort)
|
void CNetAdr2::SetIPAndPort(string svInAdr, string svInPort)
|
||||||
{
|
{
|
||||||
SetType(netadrtype_t::NA_IP);
|
SetType(netadrtype_t::NA_IP);
|
||||||
if (strcmp(svInAdr.c_str(), "loopback") == 0 || strcmp(svInAdr.c_str(), "::1") == 0)
|
if (svInAdr.compare("loopback") == 0 || svInAdr.compare("::1") == 0)
|
||||||
{
|
{
|
||||||
SetType(netadrtype_t::NA_LOOPBACK);
|
SetType(netadrtype_t::NA_LOOPBACK);
|
||||||
}
|
}
|
||||||
else if (strcmp(svInAdr.c_str(), "localhost") == 0)
|
else if (svInAdr.compare("localhost") == 0)
|
||||||
{
|
{
|
||||||
svInAdr = "127.0.0.1";
|
svInAdr = "127.0.0.1";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user