Skip to content

Commit

Permalink
findprev: use zero(eltype(T)) instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored Sep 27, 2016
1 parent 2042ee6 commit a40698a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ julia> findprev(A,1)
"""
function findprev(A, start::Integer)
for i = start:-1:1
A[i] != 0 && return i
A[i] != zero(eltype(T)) && return i
end
return 0
end
Expand Down

0 comments on commit a40698a

Please sign in to comment.