just use copyMem

This commit is contained in:
Ryan Oldenburg 2022-06-08 16:30:26 -05:00
parent d2a090514d
commit 1e092f4ae8

View file

@ -71,11 +71,11 @@ proc fillUnsafe*(
else: else:
when sizeof(int) == 8: when sizeof(int) == 8:
# Fill 8 bytes at a time when possible # Fill 8 bytes at a time when possible
let var
u32 = cast[uint32](rgbx) u32 = cast[uint32](rgbx)
u64 = cast[uint64]([u32, u32]) u64 = cast[uint64]([u32, u32])
for _ in 0 ..< len div 2: for _ in 0 ..< len div 2:
cast[ptr uint64](data[i].addr)[] = u64 copyMem(data[i].addr, u64.addr, 8)
i += 2 i += 2
# Fill whatever is left the slow way # Fill whatever is left the slow way
for j in i ..< start + len: for j in i ..< start + len: