From 551a7ab7bfcc6eee7a90171228e0baba7996345c Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 25 Oct 2018 19:45:48 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 9cf8a953..cedee8d7 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -1199,11 +1199,10 @@ namespace WebSocketSharp.Net if (count < 0 || count > len - offset) throw new ArgumentOutOfRangeException ("count"); - if (encoding == null) - encoding = Encoding.UTF8; - return count > 0 - ? encoding.GetString (urlDecodeToBytes (bytes, offset, count)) + ? (encoding ?? Encoding.UTF8).GetString ( + urlDecodeToBytes (bytes, offset, count) + ) : String.Empty; }