mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Avoid creating a unnecessary copy
Avoid copying the string out of the vector.
This commit is contained in:
parent
a1f7cc9a0d
commit
53c693f6e1
@ -242,8 +242,8 @@ bool CBanSystem::IsBanned(const string& svIpAddress, const uint64_t nNucleusID)
|
||||
{
|
||||
for (size_t i = 0; i < m_vBanList.size(); i++)
|
||||
{
|
||||
string ipAddress = m_vBanList[i].first;
|
||||
uint64_t nucleusID = m_vBanList[i].second;
|
||||
const string& ipAddress = m_vBanList[i].first;
|
||||
const uint64_t nucleusID = m_vBanList[i].second;
|
||||
|
||||
if (ipAddress.empty() ||
|
||||
!nucleusID) // Cannot be null.
|
||||
|
@ -30,8 +30,8 @@ private:
|
||||
void AuthorPlayerByName(const string& svPlayerName, const bool bBan);
|
||||
void AuthorPlayerById(const string& svHandle, const bool bBan);
|
||||
|
||||
vector<std::pair<string, uint64_t>> m_vRefuseList = {};
|
||||
vector<std::pair<string, uint64_t>> m_vBanList = {};
|
||||
vector<std::pair<string, uint64_t>> m_vRefuseList;
|
||||
vector<std::pair<string, uint64_t>> m_vBanList;
|
||||
};
|
||||
|
||||
extern CBanSystem* g_pBanSystem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user