Fixes dictionary uses (#7)
This commit is contained in:
parent
d4a52344f2
commit
916d404c51
161 changed files with 1211 additions and 1722 deletions
|
|
@ -79,11 +79,7 @@ namespace Server.Misc
|
|||
if (a.LoginIPs.Length > 0)
|
||||
{
|
||||
IPAddress ip = a.LoginIPs[0];
|
||||
|
||||
if (m_IPTable.ContainsKey(ip))
|
||||
m_IPTable[ip]++;
|
||||
else
|
||||
m_IPTable[ip] = 1;
|
||||
m_IPTable[ip] = (m_IPTable.TryGetValue(ip, out int value) ? value : 0) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -424,4 +420,4 @@ namespace Server.Misc
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue