Skip to content

Commit

Permalink
cleanup: refine code
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jan 30, 2021
1 parent 1587638 commit 2aee5a9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions loop_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ func (el *eventloop) handleEvent(fd int, filter int16) error {
if filter == netpoll.EVFilterWrite {
return el.loopWrite(c)
}
return nil
case true:
if filter == netpoll.EVFilterRead {
return el.loopRead(c)
}
return nil
}
return nil
}
return el.loopAccept(fd)
}
3 changes: 1 addition & 2 deletions loop_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ func (el *eventloop) handleEvent(fd int, ev uint32) error {
if ev&netpoll.OutEvents != 0 {
return el.loopWrite(c)
}
return nil
case true:
if ev&netpoll.InEvents != 0 {
return el.loopRead(c)
}
return nil
}
return nil
}
return el.loopAccept(fd)
}
2 changes: 0 additions & 2 deletions reactor_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ func (svr *server) activateSubReactor(el *eventloop, lockOSThread bool) {
if filter == netpoll.EVFilterWrite {
return el.loopWrite(c)
}
return nil
case true:
if filter == netpoll.EVFilterRead {
return el.loopRead(c)
}
return nil
}
}
return nil
Expand Down
2 changes: 0 additions & 2 deletions reactor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,10 @@ func (svr *server) activateSubReactor(el *eventloop, lockOSThread bool) {
if ev&netpoll.OutEvents != 0 {
return el.loopWrite(c)
}
return nil
case true:
if ev&netpoll.InEvents != 0 {
return el.loopRead(c)
}
return nil
}
}
return nil
Expand Down

0 comments on commit 2aee5a9

Please sign in to comment.