Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Commit

Permalink
Temporarily keep checkbounds fix until Travis updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Feb 9, 2015
1 parent c521933 commit af901e4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/signal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ Base.sub(sig::Signal, idxs::Union(Colon,Int,Array{Int,1},Range{Int})...) = (chec
# Use the default fast linear indexing for iteration
Base.linearindexing(::AbstractSignal) = Base.LinearFast()

# TODO: remove this once https://github.com/JuliaLang/julia/pull/10133 is merged
# (and propagates through the nightlies and Travis)
import Base: checkbounds, trailingsize
checkbounds(sz::Int, ::Colon) = nothing
function checkbounds(A::AbstractArray, I::Union(Real,Colon,AbstractArray)...)
n = length(I)
if n > 0
for dim = 1:(n-1)
checkbounds(size(A,dim), I[dim])
end
checkbounds(trailingsize(A,n), I[n])
end
end

Base.reshape(sig::Signal, idxs::(Int64...,)) = Signal(sig.time, reshape(sig.data, tuple(length(sig.time), idxs...)))

# Information specific to regular signals:
Expand Down

0 comments on commit af901e4

Please sign in to comment.