Skip to content

Commit

Permalink
fix #20997 (#21165)
Browse files Browse the repository at this point in the history
* fix #20997

* use ptr UncheckedArray[uint8] instead
  • Loading branch information
bung87 authored Apr 19, 2023
1 parent d2d849d commit 0d6b994
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/system/sets.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

# set handling

type
NimSet = array[0..8192-1, uint8]

proc cardSetImpl(s: openArray[uint8], len: int): int {.inline.} =
proc cardSetImpl(s: ptr UncheckedArray[uint8], len: int): int {.inline.} =
var i = 0
result = 0
when defined(x86) or defined(amd64):
Expand All @@ -24,5 +22,5 @@ proc cardSetImpl(s: openArray[uint8], len: int): int {.inline.} =
inc(result, countBits32(uint32(s[i])))
inc(i, 1)

proc cardSet(s: NimSet, len: int): int {.compilerproc, inline.} =
proc cardSet(s: ptr UncheckedArray[uint8], len: int): int {.compilerproc, inline.} =
result = cardSetImpl(s, len)

0 comments on commit 0d6b994

Please sign in to comment.