[Modify] Polish it

This commit is contained in:
sta 2021-03-02 19:40:21 +09:00
parent 0ffec334bb
commit f6c5c70cd9

View File

@ -74,13 +74,15 @@ namespace WebSocketSharp.Net
public int Read (byte[] buffer, int offset, int count) public int Read (byte[] buffer, int offset, int count)
{ {
var left = _data.Length - _offset; var left = _data.Length - _offset;
if (left == 0) if (left == 0)
return left; return 0;
if (count > left) if (count > left)
count = left; count = left;
Buffer.BlockCopy (_data, _offset, buffer, offset, count); Buffer.BlockCopy (_data, _offset, buffer, offset, count);
_offset += count; _offset += count;
return count; return count;