[Modify] Set String.Empty
This commit is contained in:
parent
adc38a3125
commit
f001f75ec5
@ -85,6 +85,8 @@ namespace WebSocketSharp
|
|||||||
internal PayloadData ()
|
internal PayloadData ()
|
||||||
{
|
{
|
||||||
_code = 1005;
|
_code = 1005;
|
||||||
|
_reason = String.Empty;
|
||||||
|
|
||||||
_data = WebSocket.EmptyBytes;
|
_data = WebSocket.EmptyBytes;
|
||||||
|
|
||||||
_codeSet = true;
|
_codeSet = true;
|
||||||
@ -105,7 +107,7 @@ namespace WebSocketSharp
|
|||||||
internal PayloadData (ushort code, string reason)
|
internal PayloadData (ushort code, string reason)
|
||||||
{
|
{
|
||||||
_code = code;
|
_code = code;
|
||||||
_reason = reason;
|
_reason = reason ?? String.Empty;
|
||||||
|
|
||||||
_data = code.Append (reason);
|
_data = code.Append (reason);
|
||||||
_length = _data.LongLength;
|
_length = _data.LongLength;
|
||||||
@ -153,7 +155,7 @@ namespace WebSocketSharp
|
|||||||
if (!_reasonSet) {
|
if (!_reasonSet) {
|
||||||
_reason = _length > 2
|
_reason = _length > 2
|
||||||
? _data.SubArray (2, _length - 2).UTF8Decode ()
|
? _data.SubArray (2, _length - 2).UTF8Decode ()
|
||||||
: null;
|
: String.Empty;
|
||||||
|
|
||||||
_reasonSet = true;
|
_reasonSet = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user