Skip to content

Commit bd93c38

Browse files
committed
fix sortperm for empty tuple
1 parent daf94da commit bd93c38

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/TupleTools.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ end
225225
Computes a tuple that contains the permutation required to sort `t`.
226226
"""
227227
sortperm(t::Tuple; lt=isless, by=identity, rev::Bool=false) = _sortperm(t, lt, by, rev)
228+
_sortperm(t::Tuple{}, lt=isless, by=identity, rev::Bool=false) = ()
228229
@inline function _sortperm(t::Tuple, lt=isless, by=identity, rev::Bool=false)
229230
i::Int = 1
230231
if rev

0 commit comments

Comments
 (0)