Skip to content

Commit eaa3187

Browse files
committed
[NDTensors] Only define sort(Tuple) below Julia 1.10
1 parent 56d7334 commit eaa3187

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

NDTensors/src/tupletools.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,14 @@ function getindices(t::Tuple, I::NTuple{N,Int}) where {N}
167167
end
168168

169169
# Taken from TupleTools.jl
170-
"""
171-
sort(t::Tuple; lt=isless, by=identity, rev::Bool=false) -> ::Tuple
170+
if VERSION < v"1.10.0-DEV.1404"
171+
"""
172+
sort(t::Tuple; lt=isless, by=identity, rev::Bool=false) -> ::Tuple
172173
173-
Sorts the tuple `t`.
174-
"""
175-
Base.sort(t::Tuple; lt=isless, by=identity, rev::Bool=false) = _sort(t, lt, by, rev)
174+
Sorts the tuple `t`.
175+
"""
176+
Base.sort(t::Tuple; lt=isless, by=identity, rev::Bool=false) = _sort(t, lt, by, rev)
177+
end
176178
@inline function _sort(t::Tuple, lt=isless, by=identity, rev::Bool=false)
177179
t1, t2 = _split(t)
178180
t1s = _sort(t1, lt, by, rev)

0 commit comments

Comments
 (0)