Skip to content

Commit

Permalink
improve inferrability of sort! (#46921)
Browse files Browse the repository at this point in the history
Co-authored-by: Lilith Orion Hafner <[email protected]>
  • Loading branch information
ranocha and LilithHafner authored Oct 3, 2022
1 parent 5811825 commit 9105064
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 @@ -1162,7 +1162,7 @@ function sortperm(A::AbstractArray;
min, max = extrema(A)
(diff, o1) = sub_with_overflow(max, min)
(rangelen, o2) = add_with_overflow(diff, oneunit(diff))
if !o1 && !o2 && rangelen < div(n,2)
if !(o1 || o2)::Bool && rangelen < div(n,2)
return sortperm_int_range(A, rangelen, min)
end
end
Expand Down

0 comments on commit 9105064

Please sign in to comment.