Skip to content

Commit e7344fc

Browse files
committed
findprev: use zero(eltype(T)) instead of 0
1 parent 2042ee6 commit e7344fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ julia> findprev(A,1)
11111111
"""
11121112
function findprev(A, start::Integer)
11131113
for i = start:-1:1
1114-
A[i] != 0 && return i
1114+
A[i] != zero(eltype(A)) && return i
11151115
end
11161116
return 0
11171117
end

0 commit comments

Comments
 (0)