Skip to content

Commit

Permalink
make check and getbyte more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 committed May 31, 2017
1 parent 4b0c630 commit e94b45e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e94b45e

Please sign in to comment.