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,6 +172,7 @@ proc unregister*[T](s: Selector[T], fd: int|SocketHandle) =
|
||||||
doAssert(pkey.ident != InvalidIdent,
|
doAssert(pkey.ident != InvalidIdent,
|
||||||
"Descriptor [" & $fdi & "] is not registered in the queue!")
|
"Descriptor [" & $fdi & "] is not registered in the queue!")
|
||||||
pkey.ident = InvalidIdent
|
pkey.ident = InvalidIdent
|
||||||
|
if pkey.events != {}:
|
||||||
pkey.events = {}
|
pkey.events = {}
|
||||||
s.pollRemove(fdi.cint)
|
s.pollRemove(fdi.cint)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue