Skip to content

Commit e19035f

Browse files
committed
[Modify] Polish it
1 parent 7f1fb15 commit e19035f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

websocket-sharp/Ext.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@ private static bool isHttpMethod10 (this string value)
162162

163163
private static bool isPredefinedScheme (this string value)
164164
{
165-
if (value.Length < 2)
166-
return false;
167-
168165
var c = value[0];
169166

170167
if (c == 'h')
@@ -750,10 +747,7 @@ internal static bool MaybeUri (this string value)
750747
{
751748
var idx = value.IndexOf (':');
752749

753-
if (idx == -1)
754-
return false;
755-
756-
if (idx >= 10)
750+
if (idx < 2 || idx > 9)
757751
return false;
758752

759753
var schm = value.Substring (0, idx);

0 commit comments

Comments
 (0)