[Modify] Polish it

This commit is contained in:
sta 2020-10-20 19:26:42 +09:00
parent c122e2dc72
commit 22a24c462c

View File

@ -553,19 +553,17 @@ namespace WebSocketSharp.Net
return; return;
} }
List<HttpListenerPrefix> prefs, prefs2;
do { do {
prefs = _prefixes; current = _prefixes;
if (!prefs.Contains (prefix)) if (!current.Contains (prefix))
break; break;
prefs2 = new List<HttpListenerPrefix> (prefs); future = new List<HttpListenerPrefix> (current);
prefs2.Remove (prefix); future.Remove (prefix);
} }
while ( while (
Interlocked.CompareExchange (ref _prefixes, prefs2, prefs) != prefs Interlocked.CompareExchange (ref _prefixes, future, current) != current
); );
leaveIfNoPrefix (); leaveIfNoPrefix ();