From 07184af9651514bfcd60741be3dd69c8384d428d Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Thu, 17 Mar 2022 08:39:45 +0000 Subject: [PATCH] use ptr byte cast --- faststreams/inputs.nim | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/faststreams/inputs.nim b/faststreams/inputs.nim index ea78d8a..e646338 100644 --- a/faststreams/inputs.nim +++ b/faststreams/inputs.nim @@ -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(