ioselectors_poll: don't pollRemove() if not needed
pollAdd() is called only if events set isn't empty.
This commit is contained in:
parent
0b3862df10
commit
08c6484298
1 changed files with 3 additions and 2 deletions
|
|
@ -172,8 +172,9 @@ proc unregister*[T](s: Selector[T], fd: int|SocketHandle) =
|
|||
doAssert(pkey.ident != InvalidIdent,
|
||||
"Descriptor [" & $fdi & "] is not registered in the queue!")
|
||||
pkey.ident = InvalidIdent
|
||||
pkey.events = {}
|
||||
s.pollRemove(fdi.cint)
|
||||
if pkey.events != {}:
|
||||
pkey.events = {}
|
||||
s.pollRemove(fdi.cint)
|
||||
|
||||
proc unregister*[T](s: Selector[T], ev: SelectEvent) =
|
||||
let fdi = int(ev.rfd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue