Skip to content

Commit 33154f1

Browse files
committed
fixed type inference in iterate
1 parent c2f3bf4 commit 33154f1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ParallelUtilities"
22
uuid = "fad6cfc8-4f83-11e9-06cc-151124046ad0"
33
authors = ["Jishnu Bhattacharya <[email protected]>"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"

src/ParallelUtilities.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,19 @@ end
168168
end
169169
@inline _getindex(::Tuple{},rest::Int...) = ()
170170

171-
function Base.iterate(ps::ProductSplit,state=(first(ps),1))
171+
function Base.iterate(ps::ProductSplit{T},state=(first(ps),1)) where {T}
172172
el,n = state
173173

174174
if n > length(ps)
175175
return nothing
176176
elseif n == length(ps)
177177
# In this case the next value doesn't matter, so just return something arbitary
178-
return (el,(first(ps),n+1))
178+
next_state = (el::T,n+1)
179+
else
180+
next_state = (ps[n+1]::T,n+1)
179181
end
180182

181-
(el,(ps[n+1],n+1))
183+
(el::T,next_state)
182184
end
183185

184186
@inline Base.@propagate_inbounds function _firstlastalongdim(pss::ProductSplit{<:Any,N},dim::Int,

0 commit comments

Comments
 (0)