From 71fa2da4b9d932309c0b5ab6a4eb23cd54f80414 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 23 Sep 2020 20:34:51 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/EndPointListener.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/websocket-sharp/Net/EndPointListener.cs b/websocket-sharp/Net/EndPointListener.cs index 2be87fac..1f34db26 100644 --- a/websocket-sharp/Net/EndPointListener.cs +++ b/websocket-sharp/Net/EndPointListener.cs @@ -153,12 +153,18 @@ namespace WebSocketSharp.Net #region Private Methods - private static void addSpecial (List prefixes, HttpListenerPrefix prefix) + private static void addSpecial ( + List prefixes, HttpListenerPrefix prefix + ) { var path = prefix.Path; + foreach (var pref in prefixes) { - if (pref.Path == path) - throw new HttpListenerException (87, "The prefix is already in use."); + if (pref.Path == path) { + var msg = "The prefix is already in use."; + + throw new HttpListenerException (87, msg); + } } prefixes.Add (prefix);