use minimum instead of std::min

This commit is contained in:
Robert Müller 2021-08-20 17:16:18 +02:00
parent af2d65e80a
commit 1820c72513
2 changed files with 3 additions and 3 deletions

View file

@ -914,7 +914,7 @@ void CServerBrowser::RequestCurrentServerWithRandomToken(const NETADDR &Addr, in
void CServerBrowser::SetCurrentServerPing(const NETADDR &Addr, int Ping) void CServerBrowser::SetCurrentServerPing(const NETADDR &Addr, int Ping)
{ {
SetLatency(Addr, std::min(Ping, 999)); SetLatency(Addr, minimum(Ping, 999));
} }
void ServerBrowserFillEstimatedLatency(int OwnLocation, const IServerBrowserPingCache::CEntry *pEntries, int NumEntries, int *pIndex, NETADDR Addr, CServerInfo *pInfo) void ServerBrowserFillEstimatedLatency(int OwnLocation, const IServerBrowserPingCache::CEntry *pEntries, int NumEntries, int *pIndex, NETADDR Addr, CServerInfo *pInfo)

View file

@ -173,7 +173,7 @@ CServerInfo2::operator CServerInfo() const
str_copy(Result.m_aMap, m_aMapName, sizeof(Result.m_aMap)); str_copy(Result.m_aMap, m_aMapName, sizeof(Result.m_aMap));
str_copy(Result.m_aVersion, m_aVersion, sizeof(Result.m_aVersion)); str_copy(Result.m_aVersion, m_aVersion, sizeof(Result.m_aVersion));
for(int i = 0; i < std::min(m_NumClients, (int)MAX_CLIENTS); i++) for(int i = 0; i < minimum(m_NumClients, (int)MAX_CLIENTS); i++)
{ {
str_copy(Result.m_aClients[i].m_aName, m_aClients[i].m_aName, sizeof(Result.m_aClients[i].m_aName)); str_copy(Result.m_aClients[i].m_aName, m_aClients[i].m_aName, sizeof(Result.m_aClients[i].m_aName));
str_copy(Result.m_aClients[i].m_aClan, m_aClients[i].m_aClan, sizeof(Result.m_aClients[i].m_aClan)); str_copy(Result.m_aClients[i].m_aClan, m_aClients[i].m_aClan, sizeof(Result.m_aClients[i].m_aClan));
@ -182,7 +182,7 @@ CServerInfo2::operator CServerInfo() const
Result.m_aClients[i].m_Player = m_aClients[i].m_IsPlayer; Result.m_aClients[i].m_Player = m_aClients[i].m_IsPlayer;
} }
Result.m_NumReceivedClients = std::min(m_NumClients, (int)MAX_CLIENTS); Result.m_NumReceivedClients = minimum(m_NumClients, (int)MAX_CLIENTS);
Result.m_Latency = -1; Result.m_Latency = -1;
return Result; return Result;