diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-04-01 14:34:24 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2020-04-01 19:38:44 +0200 |
commit | 484548c784f69cadc1f6480a24e99183a0e6a930 (patch) | |
tree | d79ee14aa8cc6ce07690764b6204a81529a6c0d3 /lib/pure/ioselects/ioselectors_select.nim | |
parent | 66f18037b3d10dca7d32675651ec969217036992 (diff) | |
download | Nim-484548c784f69cadc1f6480a24e99183a0e6a930.tar.gz |
revert stdlib changes which are not required anymore
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(): |