diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 17e6c923..5b520a42 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -843,10 +843,7 @@ namespace WebSocketSharp.Net if (s == null) throw new ArgumentNullException ("s"); - if (s.Length == 0) - return s; - - return htmlAttributeEncode (s); + return s.Length > 0 ? htmlAttributeEncode (s) : s; } public static void HtmlAttributeEncode (string s, TextWriter output)