From 1e092f4ae83a6ccb34344d730ec2c3b587266458 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 8 Jun 2022 16:30:26 -0500 Subject: [PATCH] just use copyMem --- src/pixie/internal.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pixie/internal.nim b/src/pixie/internal.nim index ead70e4..e5cb53e 100644 --- a/src/pixie/internal.nim +++ b/src/pixie/internal.nim @@ -71,11 +71,11 @@ proc fillUnsafe*( else: when sizeof(int) == 8: # Fill 8 bytes at a time when possible - let + var u32 = cast[uint32](rgbx) u64 = cast[uint64]([u32, u32]) for _ in 0 ..< len div 2: - cast[ptr uint64](data[i].addr)[] = u64 + copyMem(data[i].addr, u64.addr, 8) i += 2 # Fill whatever is left the slow way for j in i ..< start + len: