minor code cleanups (#21215)
This commit is contained in:
parent
e9ed090c33
commit
cf1b16ef8b
6 changed files with 32 additions and 36 deletions
|
|
@ -112,9 +112,9 @@ const invalidSlot = uint8.high
|
|||
|
||||
proc genLookup[T: typedesc[HoleyEnum]](_: T): auto =
|
||||
const n = span(T)
|
||||
var ret: array[n, uint8]
|
||||
var i = 0
|
||||
assert n <= invalidSlot.int
|
||||
var ret {.noinit.}: array[n, uint8]
|
||||
for ai in mitems(ret): ai = invalidSlot
|
||||
for ai in items(T):
|
||||
ret[ai.ord - T.low.ord] = uint8(i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue