copymem for unfiltered rows

This commit is contained in:
Ryan Oldenburg 2021-04-28 17:04:34 -05:00
parent 6c9abf4084
commit 4804293a4a

View file

@ -104,9 +104,11 @@ proc unfilter(
let filterType = uncompressed[uncompressedIdx(0, y)]
case filterType:
of 0: # None
for x in 0 ..< rowBytes:
var value = uncompressed[uncompressedIdx(x + 1, y)]
result[unfiteredIdx(x, y)] = value
copyMem(
result[unfiteredIdx(0, y)].addr,
uncompressed[uncompressedIdx(1, y)].unsafeAddr,
rowBytes
)
of 1: # Sub
for x in 0 ..< rowBytes:
var value = uncompressed[uncompressedIdx(x + 1, y)]