Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix invalidations in sort! from Static.jl #46491

Merged
merged 5 commits into from
Aug 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert "move Bool annotation to definition of lt"
This reverts commit 0de5fe5.
  • Loading branch information
ranocha committed Aug 29, 2022
commit 5597c4b1c7f5bb0ca6895f30d01c67375e7dfdbd
6 changes: 3 additions & 3 deletions base/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function sort!(v::AbstractVector, lo::Integer, hi::Integer, ::InsertionSortAlg,
x = v[i]
while j > lo
y = v[j-1]
if !lt(o, x, y)
if !(lt(o, x, y)::Bool)
break
end
v[j] = y
Expand Down Expand Up @@ -1486,8 +1486,8 @@ right(::DirectOrdering) = Right()
left(o::Perm) = Perm(left(o.order), o.data)
right(o::Perm) = Perm(right(o.order), o.data)

lt(::Left, x::T, y::T)::Bool where {T<:Floats} = slt_int(y, x)
lt(::Right, x::T, y::T)::Bool where {T<:Floats} = slt_int(x, y)
lt(::Left, x::T, y::T) where {T<:Floats} = slt_int(y, x)
lt(::Right, x::T, y::T) where {T<:Floats} = slt_int(x, y)

uint_map(x::Float16, ::Left) = ~reinterpret(UInt16, x)
uint_unmap(::Type{Float16}, u::UInt16, ::Left) = reinterpret(Float16, ~u)
Expand Down