diff options
Diffstat (limited to 'lib/pure/ioselects/ioselectors_select.nim')
-rw-r--r-- | lib/pure/ioselects/ioselectors_select.nim | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/pure/ioselects/ioselectors_select.nim b/lib/pure/ioselects/ioselectors_select.nim index 6a742df99..02a853b42 100644 --- a/lib/pure/ioselects/ioselectors_select.nim +++ b/lib/pure/ioselects/ioselectors_select.nim @@ -410,17 +410,11 @@ else: body proc getData*[T](s: Selector[T], fd: SocketHandle|int): var T = - # The compiler needs this to prove that all code paths return a value - result = (cast[ptr T](0'u))[] - s.withSelectLock(): let fdi = int(fd) for i in 0..<FD_SETSIZE: if s.fds[i].ident == fdi: - result = s.fds[i].data - break - - assert cast[uint](addr(result)) != 0 + return s.fds[i].data proc setData*[T](s: Selector[T], fd: SocketHandle|int, data: T): bool = s.withSelectLock(): |