[Modify] Polish it

This commit is contained in:
sta 2018-12-24 17:55:07 +09:00
parent 71bfade226
commit 4a71717116

View File

@ -267,15 +267,14 @@ namespace WebSocketSharp.Net
buff.Append ((char) number); buff.Append ((char) number);
} }
entity.Length = 0;
haveTrailingDigits = false; haveTrailingDigits = false;
entity.Length = 0;
state = 0; state = 0;
continue;
} }
else if (Char.IsDigit (c)) {
number = number * 10 + ((int) c - '0'); if (!Char.IsDigit (c)) {
haveTrailingDigits = true;
}
else {
if (haveTrailingDigits) { if (haveTrailingDigits) {
entity.Append (number.ToString (CultureInfo.InvariantCulture)); entity.Append (number.ToString (CultureInfo.InvariantCulture));
haveTrailingDigits = false; haveTrailingDigits = false;
@ -283,8 +282,13 @@ namespace WebSocketSharp.Net
entity.Append (c); entity.Append (c);
state = 2; state = 2;
continue;
} }
number = number * 10 + (c - '0');
haveTrailingDigits = true;
continue; continue;
} }
} }