close #11330 sets uses optimized countSetBits (#17334)

* Update lib/pure/bitops.nim
* Update lib/system/sets.nim
* Apply suggestions from code review

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
flywind 2021-03-22 07:36:48 +08:00 • committed by GitHub
commit c8dda867f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 98 additions and 85 deletions

View file

@ -12,7 +12,6 @@
type
NimSet = array[0..4*2048-1, uint8]
# bitops can't be imported here, therefore the code duplication.
proc cardSet(s: NimSet, len: int): int {.compilerproc, inline.} =
var i = 0