From 4a71717116ae4a5ec4ebbce15ad369997f38b89d Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 24 Dec 2018 17:55:07 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index a1ccf1a0..e23ad343 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -267,15 +267,14 @@ namespace WebSocketSharp.Net buff.Append ((char) number); } - entity.Length = 0; haveTrailingDigits = false; + entity.Length = 0; state = 0; + + continue; } - else if (Char.IsDigit (c)) { - number = number * 10 + ((int) c - '0'); - haveTrailingDigits = true; - } - else { + + if (!Char.IsDigit (c)) { if (haveTrailingDigits) { entity.Append (number.ToString (CultureInfo.InvariantCulture)); haveTrailingDigits = false; @@ -283,8 +282,13 @@ namespace WebSocketSharp.Net entity.Append (c); state = 2; + + continue; } + number = number * 10 + (c - '0'); + haveTrailingDigits = true; + continue; } }