mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 18:07:22 +01:00
minor refactoring
This commit is contained in:
parent
142c65cc9d
commit
7baca3565a
34 changed files with 554 additions and 627 deletions
|
|
@ -152,10 +152,10 @@
|
|||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
return _baseStream.ToString();
|
||||
return _baseStream?.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
private class Bandwidth
|
||||
private sealed class Bandwidth
|
||||
{
|
||||
private long _count;
|
||||
private int _lastSecondCheckpoint;
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
{
|
||||
int elapsedTime = Environment.TickCount - _lastSecondCheckpoint + 1;
|
||||
receivedBytesCount = Interlocked.Add(ref _lastTransferredBytesCount, receivedBytesCount);
|
||||
double momentSpeed = receivedBytesCount * 1000 / elapsedTime; // B/s
|
||||
double momentSpeed = receivedBytesCount * 1000 / (double)elapsedTime; // B/s
|
||||
|
||||
if (1000 < elapsedTime)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue