Hrm, the new errors highlighted some code that seems to be broken

New issue: since `Table[A, B]` allocates its backing storage with
`newSeq[KeyValuePair[A, B]]`, it's no longer legal to create a table
with `not nil` types used as either keys or values.
This commit is contained in:
Zahary Karadjov 2020-03-29 02:17:47 +02:00 • committed by Andreas Rumpf
commit 0521f98486
8 changed files with 23 additions and 22 deletions

View file

@ -600,8 +600,7 @@ proc contains*[T](s: Selector[T], fd: SocketHandle|int): bool {.inline.} =
proc getData*[T](s: Selector[T], fd: SocketHandle|int): var T =
let fdi = int(fd)
s.checkFd(fdi)
if fdi in s:
result = s.fds[fdi].data
result = s.fds[fdi].data
proc setData*[T](s: Selector[T], fd: SocketHandle|int, data: T): bool =
let fdi = int(fd)