Skip to content

Commit

Permalink
Add more specialization hints to the compiler (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Aug 9, 2020
1 parent 71524aa commit 061a65f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/processes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ end
complete(rf, @return_if_reduced foldlargs(rf, init, coll...))

# TODO: use IndexStyle
@inline function __foldl__(rf, init, arr::Union{AbstractArray, Broadcasted})
@inline function __foldl__(rf::RF, init, arr::Union{AbstractArray,Broadcasted}) where {RF}
isempty(arr) && return complete(rf, init)
idxs = eachindex(arr)
val = @next(rf, init, @inbounds arr[idxs[firstindex(idxs)]])
Expand Down Expand Up @@ -324,7 +324,8 @@ end
Call [`__foldl__`](@ref) without calling [`complete`](@ref).
"""
@inline foldl_nocomplete(rf, init, coll) = __foldl__(skipcomplete(rf), init, coll)
@inline foldl_nocomplete(rf::RF, init, coll) where {RF} =
__foldl__(skipcomplete(rf), init, coll)

"""
foldxl(step, xf::Transducer, reducible; init, simd) :: T
Expand Down

0 comments on commit 061a65f

Please sign in to comment.