From 1bbac5e3da9b8dd9f3c5e675713990c18a3c5455 Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 4 Sep 2018 19:46:29 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 407c0664..1087a90e 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1161,8 +1161,11 @@ namespace WebSocketSharp.Net public static byte[] UrlEncodeToBytes (byte[] bytes) { - int len; - return bytes != null && (len = bytes.Length) > 0 + if (bytes == null) + return null; + + var len = bytes.Length; + return len > 0 ? InternalUrlEncodeToBytes (bytes, 0, len) : bytes; }