diff --git a/base/sort.jl b/base/sort.jl index eb57da376f4ab..281a75cac309e 100644 --- a/base/sort.jl +++ b/base/sort.jl @@ -812,6 +812,16 @@ Characteristics: it is well-suited to small collections but should not be used for large ones. """ const InsertionSort = InsertionSortAlg() + +""" + SMALL_ALGORITHM + +Default sorting algorithm for small arrays. + +This is an alias for a simple low-overhead algorithm that does not scale well +to large arrays, unlike high-overhead recursive algorithms used for larger arrays. +`SMALL_ALGORITHM` is a good choice for the base case of a recursive algorithm. +""" const SMALL_ALGORITHM = InsertionSortAlg() function _sort!(v::AbstractVector, ::InsertionSortAlg, o::Ordering, kw) diff --git a/test/sorting.jl b/test/sorting.jl index d1875c9727a29..2714197f58823 100644 --- a/test/sorting.jl +++ b/test/sorting.jl @@ -12,7 +12,7 @@ using .Main.OffsetArrays @testset "Base.Sort docstrings" begin undoc = Docs.undocumented_names(Base.Sort) @test_broken isempty(undoc) - @test undoc == [:Algorithm, :SMALL_ALGORITHM, :SMALL_THRESHOLD, :Sort] + @test undoc == [:Algorithm, :SMALL_THRESHOLD, :Sort] end @testset "Order" begin