Skip to content

Commit

Permalink
trifle: remove unreachable and useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Feb 13, 2020
1 parent 52c5f31 commit e18b177
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions eventloop_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ func (el *eventloop) loopCloseConn(c *conn, err error) error {
}

func (el *eventloop) loopWake(c *conn) error {
if co, ok := el.connections[c.fd]; !ok || co != c {
return nil // ignore stale wakes.
}
//if co, ok := el.connections[c.fd]; !ok || co != c {
// return nil // ignore stale wakes.
//}
out, action := el.eventHandler.React(nil, c)
if out != nil {
frame, _ := el.codec.Encode(c, out)
Expand Down
6 changes: 3 additions & 3 deletions eventloop_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ func (el *eventloop) loopError(c *stdConn, err error) (e error) {
}

func (el *eventloop) loopWake(c *stdConn) error {
if _, ok := el.connections[c]; !ok {
return nil // ignore stale wakes.
}
//if co, ok := el.connections[c]; !ok || co != c {
// return nil // ignore stale wakes.
//}
out, action := el.eventHandler.React(nil, c)
if out != nil {
frame, _ := el.codec.Encode(c, out)
Expand Down
1 change: 0 additions & 1 deletion gnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ func (t *testWakeConnServer) OnOpened(c Conn) (out []byte, action Action) {
return
}
func (t *testWakeConnServer) OnClosed(c Conn, err error) (action Action) {
_ = t.conn.Wake()
action = Shutdown
return
}
Expand Down

0 comments on commit e18b177

Please sign in to comment.