Use better code
This commit is contained in:
parent
608e7a99bc
commit
75c8a8ced4
32 changed files with 77 additions and 105 deletions
|
|
@ -67,14 +67,10 @@ namespace Rests
|
|||
|
||||
private void AddTokenToBucket(string ip)
|
||||
{
|
||||
if (tokenBucket.ContainsKey(ip))
|
||||
if (!tokenBucket.TryAdd(ip, 1))
|
||||
{
|
||||
tokenBucket[ip] += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
tokenBucket.Add(ip, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private object DestroyToken(RestRequestArgs args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue