Skip to content

Commit

Permalink
Fix early return for empty ranges in argsortnans!
Browse files Browse the repository at this point in the history
  • Loading branch information
brenhinkeller committed Dec 28, 2024
1 parent b90d936 commit 9aef19a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NaNStatistics"
uuid = "b946abbf-3ea7-4610-9019-9858bfdeaf2d"
authors = ["C. Brenhin Keller"]
version = "0.6.44"
version = "0.6.45"

[deps]
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Expand Down
2 changes: 1 addition & 1 deletion src/Sorting/quicksort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function sortnans!(A::AbstractArray, iₗ::Int=firstindex(A), iᵤ::Int=lastinde
end
function argsortnans!(I::AbstractArray, A::AbstractArray, iₗ::Int=firstindex(A), iᵤ::Int=lastindex(A))
# Return early if range is empty
iₗ >= iᵤ && return A, iₗ, iᵤ
iₗ >= iᵤ && return I, A, iₗ, iᵤ

# Count up NaNs
Nₙₐₙ = 0
Expand Down

0 comments on commit 9aef19a

Please sign in to comment.