Fixes dictionary uses (#7)

This commit is contained in:
Kamron Batman 2018-11-02 08:16:42 -07:00 • committed by GitHub
parent d4a52344f2
commit 916d404c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 1211 additions and 1722 deletions

View file

@ -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;
}
}
}
}