[Modify] Polish it

This commit is contained in:
sta 2021-03-01 21:24:30 +09:00
parent 26b108ae29
commit 94ef38537c

View File

@ -336,10 +336,13 @@ namespace WebSocketSharp.Net
write (buffer, ref offset, length); write (buffer, ref offset, length);
} }
private InputChunkState writeData (byte[] buffer, ref int offset, int length) private InputChunkState writeData (
byte[] buffer, ref int offset, int length
)
{ {
var cnt = length - offset; var cnt = length - offset;
var left = _chunkSize - _chunkRead; var left = _chunkSize - _chunkRead;
if (cnt > left) if (cnt > left)
cnt = left; cnt = left;
@ -350,7 +353,9 @@ namespace WebSocketSharp.Net
offset += cnt; offset += cnt;
_chunkRead += cnt; _chunkRead += cnt;
return _chunkRead == _chunkSize ? InputChunkState.DataEnded : InputChunkState.Data; return _chunkRead == _chunkSize
? InputChunkState.DataEnded
: InputChunkState.Data;
} }
#endregion #endregion