Skip to content

Commit

Permalink
put back update defalg after bootstrapping (ugly)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner committed Feb 22, 2022
1 parent 447300b commit e61902f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ include("util.jl")

include("asyncmap.jl")

Sort.defalg(v::AbstractArray) = DEFAULT_STABLE
Sort.defalg(v::AbstractArray{<:Union{Number, Missing}}) = DEFAULT_UNSTABLE
Sort.defalg(v::AbstractArray{Missing}) = DEFAULT_UNSTABLE
Sort.defalg(v::AbstractArray{Union{}}) = DEFAULT_UNSTABLE

# deprecated functions
include("deprecated.jl")

Expand Down
12 changes: 6 additions & 6 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ Characteristics:
"""
const MergeSort = MergeSortAlg()

const DEFAULT_UNSTABLE = QuickSort
const DEFAULT_STABLE = MergeSort
const DEFAULT_UNSTABLE = RadixSort(QuickSort)
const DEFAULT_STABLE = RadixSort(MergeSort)
const SMALL_ALGORITHM = InsertionSort
const SMALL_THRESHOLD = 20

Expand Down Expand Up @@ -751,10 +751,10 @@ end

## generic sorting methods ##

defalg(v::AbstractArray) = DEFAULT_STABLE
defalg(v::AbstractArray{<:Union{Number, Missing}}) = DEFAULT_UNSTABLE
defalg(v::AbstractArray{Missing}) = DEFAULT_UNSTABLE
defalg(v::AbstractArray{Union{}}) = DEFAULT_UNSTABLE
defalg(v::AbstractArray) = MergeSort
defalg(v::AbstractArray{<:Union{Number, Missing}}) = QuickSort
defalg(v::AbstractArray{Missing}) = QuickSort
defalg(v::AbstractArray{Union{}}) = QuickSort

function sort!(v::AbstractVector, alg::Algorithm, order::Ordering)
inds = axes(v,1)
Expand Down

0 comments on commit e61902f

Please sign in to comment.