Skip to content

Commit

Permalink
Update base/sort.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner authored Dec 1, 2024
1 parent 27b3ce4 commit b15776f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ function sort(x::NTuple;
order::Ordering=Forward,
scratch::Union{Vector, Nothing}=nothing)
# Can't do this check with type parameters because of https://github.com/JuliaLang/julia/issues/56698
scratch === nothing || x isa NTuple{<:Any, eltype(scratch)} || throw(ArgumentError("scratch's eltype can't accommodate all the input elements"))
scratch === nothing || eltype(x) == eltype(scratch) || throw(ArgumentError("scratch has the wrong eltype"))
_sort(x, alg, ord(lt,by,rev,order), (;scratch))::typeof(x)
end
# Folks who want to hack internals can define a new _sort(x::NTuple, ::TheirAlg, o::Ordering)
Expand Down

0 comments on commit b15776f

Please sign in to comment.