Skip to content

Commit

Permalink
move Bool annotation to definition of lt
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha authored Aug 26, 2022
1 parent 6352a5b commit bbf1bde
Showing 1 changed file with 3 additions and 3 deletions.
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)::Bool)
if !lt(o, x, y)
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) where {T<:Floats} = slt_int(y, x)
lt(::Right, x::T, y::T) where {T<:Floats} = slt_int(x, y)
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)

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

0 comments on commit bbf1bde

Please sign in to comment.