Fix typo in align
in utils.
This commit is contained in:
parent
82be9ea1db
commit
41c7c7092a
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ func align4*[T: SomeInteger](n: T): T = n + ((4-(n and 3)) and 3)
|
||||||
func align*[T: SomeInteger](n, align: T): T =
|
func align*[T: SomeInteger](n, align: T): T =
|
||||||
let mask = align - 1
|
let mask = align - 1
|
||||||
assert((align and mask) == 0, "align must be a power of two")
|
assert((align and mask) == 0, "align must be a power of two")
|
||||||
return n + ((4-(n and mask)) and mask)
|
return n + ((align-(n and mask)) and mask)
|
||||||
|
|
||||||
func bytelen*[T](s: seq[T]): int = s.len * sizeof(T)
|
func bytelen*[T](s: seq[T]): int = s.len * sizeof(T)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue