From e94b45eebabab8d0ab209370bcc985477689b789 Mon Sep 17 00:00:00 2001 From: Kenta Sato Date: Wed, 31 May 2017 09:31:49 +0900 Subject: [PATCH] make check and getbyte more generic --- src/codegen.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen.jl b/src/codegen.jl index ec80216a..faa5326e 100644 --- a/src/codegen.jl +++ b/src/codegen.jl @@ -381,10 +381,10 @@ end return unsafe_load(pointer(data), p) end -@inline function check(data::AbstractVector{UInt8}, p::Integer) - return 1 ≤ p ≤ endof(data) +@inline function check(data, p::Integer) + return checkbounds(Bool, data, p) end -@inline function getbyte(data::AbstractVector{UInt8}, p::Integer) +@inline function getbyte(data, p::Integer) @inbounds return data[p] end