Skip to content

Commit aa340e2

Browse files
committed
add Base.Order.lt specialization for Perm{<:Any,<:StaticVector}
1 parent dcb707f commit aa340e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sort.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ end
3636
return SVector{length(a),Int}(_sort(p, alg, ordr))
3737
end
3838

39+
@inline @propagate_inbounds Base.Order.lt(p::Perm{<:Base.Order.Ordering,<:StaticVector}, a::Integer, b::Integer) =
40+
lt(p.order, (p.data[a], a), (p.data[b], b))
3941

4042
@inline _sort(a::StaticVector, alg, order) =
4143
similar_type(a)(sort!(Base.copymutable(a); alg=alg, order=order))

0 commit comments

Comments
 (0)