Skip to content

Commit 5eb5f34

Browse files
committed
findmax bugfix
1 parent bda0668 commit 5eb5f34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TupleTools.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ end
218218
Returns the value and index of the maximum element in a tuple. If there are multiple
219219
maximal elements, then the first one will be returned.
220220
"""
221-
findmax(::Tuple{Any}) = 1
221+
findmax(::Tuple{Any}) = (t[1], 1)
222222
findmax(t::Tuple) = _findmax(tail(t),2,t[1],1)
223223
@inline _findmax(t::Tuple{}, s, v, i) = (v, i)
224224
@inline function _findmax(t::Tuple, s, v, i)

0 commit comments

Comments
 (0)