Visual Studio C#7 suggestions
This commit is contained in:
@@ -19,8 +19,7 @@ namespace Discord.Net.Converters
|
||||
if (property.Ignored)
|
||||
return property;
|
||||
|
||||
var propInfo = member as PropertyInfo;
|
||||
if (propInfo != null)
|
||||
if (member is PropertyInfo propInfo)
|
||||
{
|
||||
var converter = GetConverter(property, propInfo, propInfo.PropertyType, 0);
|
||||
if (converter != null)
|
||||
|
||||
@@ -114,9 +114,8 @@ namespace Discord.Net.Queue
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
foreach (var bucket in _buckets.Select(x => x.Value))
|
||||
{
|
||||
RequestBucket ignored;
|
||||
if ((now - bucket.LastAttemptAt).TotalMinutes > 1.0)
|
||||
_buckets.TryRemove(bucket.Id, out ignored);
|
||||
_buckets.TryRemove(bucket.Id, out RequestBucket ignored);
|
||||
}
|
||||
await Task.Delay(60000, _cancelToken.Token); //Runs each minute
|
||||
}
|
||||
|
||||
@@ -14,9 +14,8 @@ namespace Discord.Net
|
||||
|
||||
internal RateLimitInfo(Dictionary<string, string> headers)
|
||||
{
|
||||
string temp;
|
||||
IsGlobal = headers.TryGetValue("X-RateLimit-Global", out temp) &&
|
||||
bool.TryParse(temp, out var isGlobal) ? isGlobal : false;
|
||||
IsGlobal = headers.TryGetValue("X-RateLimit-Global", out string temp) &&
|
||||
bool.TryParse(temp, out var isGlobal) ? isGlobal : false;
|
||||
Limit = headers.TryGetValue("X-RateLimit-Limit", out temp) &&
|
||||
int.TryParse(temp, out var limit) ? limit : (int?)null;
|
||||
Remaining = headers.TryGetValue("X-RateLimit-Remaining", out temp) &&
|
||||
|
||||
Reference in New Issue
Block a user