Skip to content

Commit

Permalink
Use generated function instead of eval
Browse files Browse the repository at this point in the history
  • Loading branch information
galenlynch committed Apr 2, 2019
1 parent fc03a14 commit a59adfb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Filters/filt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,10 @@ const SMALL_FILT_CUTOFF = 15
#
# filt implementation for FIR filters (faster than Base)
#

for n = 2:SMALL_FILT_CUTOFF
silen = n-1
@generated function filt!(out, b::NTuple{N,T}, x) where {N, T}
silen = N-1
si = [Symbol("si$i") for i = 1:silen]
@eval function filt!(out, b::NTuple{$n,T}, x) where T
return quote
size(x) != size(out) && error("out size must match x")
ncols = Base.trailingsize(x, 2)
for col = 0:ncols-1
Expand Down

0 comments on commit a59adfb

Please sign in to comment.