[Modify] Use it

This commit is contained in:
sta 2019-02-18 20:27:01 +09:00
parent 0611e8a276
commit 884ac97de8

View File

@ -109,7 +109,6 @@ namespace WebSocketSharp.Net
_name = String.Empty; _name = String.Empty;
_path = String.Empty; _path = String.Empty;
_port = String.Empty; _port = String.Empty;
_ports = new int[0];
_timestamp = DateTime.Now; _timestamp = DateTime.Now;
_value = String.Empty; _value = String.Empty;
_version = 0; _version = 0;
@ -272,7 +271,7 @@ namespace WebSocketSharp.Net
internal int[] Ports { internal int[] Ports {
get { get {
return _ports; return _ports ?? _emptyPorts;
} }
} }
@ -485,7 +484,7 @@ namespace WebSocketSharp.Net
set { set {
if (value.IsNullOrEmpty ()) { if (value.IsNullOrEmpty ()) {
_port = String.Empty; _port = String.Empty;
_ports = new int[0]; _ports = null;
return; return;
} }