Skip to content

Commit 171df40

Browse files
committed
Refactored HttpConnection.cs
1 parent 477ef22 commit 171df40

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

websocket-sharp/Net/HttpConnection.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,18 +395,21 @@ private string readLine (byte[] buffer, int offset, int length, ref int used)
395395

396396
private void removeConnection ()
397397
{
398-
if (_lastListener == null)
398+
if (_lastListener == null) {
399399
_listener.RemoveConnection (this);
400-
else
401-
_lastListener.RemoveConnection (this);
400+
return;
401+
}
402+
403+
_lastListener.RemoveConnection (this);
402404
}
403405

404406
private void unbind ()
405407
{
406-
if (_contextWasBound) {
407-
_listener.UnbindContext (_context);
408-
_contextWasBound = false;
409-
}
408+
if (!_contextWasBound)
409+
return;
410+
411+
_listener.UnbindContext (_context);
412+
_contextWasBound = false;
410413
}
411414

412415
#endregion

0 commit comments

Comments
 (0)