diff options
author | Araq <rumpf_a@web.de> | 2015-08-02 01:42:41 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-02 02:56:00 +0200 |
commit | e9899af9b20b1ac55c66b32a8ab354942ef2816f (patch) | |
tree | 998e063e5461a20857af053105981ad16c5a2cba | |
parent | 41e8c9b9acc16f65166648aaba38408dad42e7bc (diff) | |
download | Nim-e9899af9b20b1ac55c66b32a8ab354942ef2816f.tar.gz |
fixes #3135
-rw-r--r-- | lib/system/sets.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/system/sets.nim b/lib/system/sets.nim index 22d6d57c0..66877de30 100644 --- a/lib/system/sets.nim +++ b/lib/system/sets.nim @@ -19,9 +19,9 @@ proc countBits32(n: int32): int {.compilerproc.} = v = (v and 0x33333333'i32) +% ((v shr 2'i32) and 0x33333333'i32) result = ((v +% (v shr 4'i32) and 0xF0F0F0F'i32) *% 0x1010101'i32) shr 24'i32 -proc countBits64(n: int64): int {.compilerproc.} = - result = countBits32(toU32(n and 0xffff'i64)) + - countBits32(toU32(n shr 16'i64)) +proc countBits64(n: int64): int {.compilerproc.} = + result = countBits32(toU32(n and 0xffffffff'i64)) + + countBits32(toU32(n shr 32'i64)) proc cardSet(s: NimSet, len: int): int {.compilerproc.} = result = 0 |