mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
ioselectors_poll: don't pollRemove() if not needed
pollAdd() is called only if events set isn't empty.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user