Skip to content

Commit 1ca0d89

Browse files
Reduce the threshold for handoff to base partialsort
1 parent fac3079 commit 1ca0d89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/quicksort.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ sortnans!(A::AbstractArray{<:Integer}, iₗ::Int=firstindex(A), iᵤ::Int=lastin
7373

7474
# Partially sort `A` around the `k`th sorted element and return that element
7575
function quickselect!(A::AbstractArray, iₗ::Int=firstindex(A), iᵤ::Int=lastindex(A), k=(iₗ+iᵤ)÷2)
76-
# Fall back to Base implementation for very large arrays
77-
if iᵤ-iₗ > 20000
76+
# Fall back to Base implementation for large arrays
77+
if iᵤ-iₗ > 9999
7878
return Base.Sort.partialsort!(view(A, iₗ:iᵤ), k-(iₗ-1))
7979
end
8080

0 commit comments

Comments
 (0)