Visual Studio C#7 suggestions

This commit is contained in:
Christopher F
2017-04-23 15:23:06 -04:00
parent 6000b15c4d
commit 431b7fbd9f
21 changed files with 80 additions and 165 deletions

View File

@@ -131,8 +131,7 @@ namespace Discord.Audio
await keepaliveTask.ConfigureAwait(false);
_keepaliveTask = null;
long time;
while (_heartbeatTimes.TryDequeue(out time)) { }
while (_heartbeatTimes.TryDequeue(out long time)) { }
_lastMessageTime = 0;
await ClearInputStreamsAsync().ConfigureAwait(false);
@@ -186,8 +185,7 @@ namespace Discord.Audio
}
internal AudioInStream GetInputStream(ulong id)
{
StreamPair streamPair;
if (_streams.TryGetValue(id, out streamPair))
if (_streams.TryGetValue(id, out StreamPair streamPair))
return streamPair.Reader;
return null;
}
@@ -254,8 +252,7 @@ namespace Discord.Audio
{
await _audioLogger.DebugAsync("Received HeartbeatAck").ConfigureAwait(false);
long time;
if (_heartbeatTimes.TryDequeue(out time))
if (_heartbeatTimes.TryDequeue(out long time))
{
int latency = (int)(Environment.TickCount - time);
int before = Latency;