Skip to content

Commit

Permalink
Use @views where appropriate
Browse files Browse the repository at this point in the history
Co-authored-by: wheeheee <[email protected]>
  • Loading branch information
martinholters and wheeheee authored Dec 17, 2024
1 parent 2c195d3 commit 6a1f2ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Filters/filt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function filt!(out::AbstractArray{<:Any,N}, f::DF2TFilter{<:PolynomialRatio,Arra
a = coefa(f.coef)
if length(a) != 1
for col in CartesianIndices(axes(x)[2:end])
_filt_iir!(view(out, :, col), b, a, view(x, :, col), view(si, :, col))
@views _filt_iir!(out[:, col], b, a, x[:, col], si[:, col])
end
elseif n <= SMALL_FILT_CUTOFF
vtup = ntuple(j -> b[j], Val(length(b)))
Expand Down
2 changes: 1 addition & 1 deletion src/dspbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function filt!(out::AbstractArray, b::Union{AbstractVector, Number}, a::Union{Ab
# Reset the filter state
fill!(si, zero(eltype(si)))
if as > 1
_filt_iir!(view(out, :, col), b, a, view(x, :, col), si)
@views _filt_iir!(out[:, col], b, a, x[:, col], si)
else
_filt_fir!(out, b, x, si, col)
end
Expand Down

0 comments on commit 6a1f2ef

Please sign in to comment.