use ptr byte cast

This commit is contained in:
Dustin Brody 2022-03-17 08:39:45 +00:00
commit 07184af965
No known key found for this signature in database
GPG key ID: 3D7A11A0156519DC

View file

@ -442,11 +442,7 @@ proc fileInput*(filename: string,
return fileInput(file, offset, pageSize)
proc unsafeMemoryInput*(mem: openArray[byte]): InputStreamHandle =
let head =
if mem.len > 0:
unsafeAddr mem[0]
else:
default(ptr byte)
let head = cast[ptr byte](mem)
makeHandle InputStream(
span: PageSpan(