Remove var
Shouldn't testing bit require only immutable access? I think this is a typo
This commit is contained in:
parent
aed8766e84
commit
7e52c798db
1 changed files with 1 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ when defined(nimHasalignOf):
|
||||||
for bit in bits:
|
for bit in bits:
|
||||||
result.add newCall("flipBit", v, bit)
|
result.add newCall("flipBit", v, bit)
|
||||||
|
|
||||||
proc testBit*[T: SomeInteger](v: var T, bit: BitsRange[T]): bool {.inline.} =
|
proc testBit*[T: SomeInteger](v: T, bit: BitsRange[T]): bool {.inline.} =
|
||||||
## Returns true if the bit in ``v`` at positions ``bit`` is set to 1
|
## Returns true if the bit in ``v`` at positions ``bit`` is set to 1
|
||||||
let mask = 1.T shl bit
|
let mask = 1.T shl bit
|
||||||
return (v and mask) == mask
|
return (v and mask) == mask
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue