From 4fbcd862f32c5e016c7ae73635992cf7a31f25b7 Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 13 Jan 2015 16:07:56 +0900 Subject: [PATCH] Refactored a few for HttpConnection.cs --- websocket-sharp/Net/HttpConnection.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/websocket-sharp/Net/HttpConnection.cs b/websocket-sharp/Net/HttpConnection.cs index 6d7d41f5..74efcaff 100644 --- a/websocket-sharp/Net/HttpConnection.cs +++ b/websocket-sharp/Net/HttpConnection.cs @@ -395,12 +395,10 @@ namespace WebSocketSharp.Net private void removeConnection () { - if (_lastListener == null) { + if (_lastListener != null) + _lastListener.RemoveConnection (this); + else _listener.RemoveConnection (this); - return; - } - - _lastListener.RemoveConnection (this); } private void unbind ()