Skip to content

Commit

Permalink
improve type stability of lt(p::Perm, a::Integer, b::Integer) (Juli…
Browse files Browse the repository at this point in the history
…aLang#46732)

This fixes a few hundred invalidations when loading Static/jl/ArrayInterface.jl.
  • Loading branch information
ranocha committed Sep 14, 2022
1 parent 6e5b4b4 commit d0b6a17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/ordering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ lt(o::Lt, a, b) = o.lt(a,b)
@propagate_inbounds function lt(p::Perm, a::Integer, b::Integer)
da = p.data[a]
db = p.data[b]
lt(p.order, da, db) | (!lt(p.order, db, da) & (a < b))
(lt(p.order, da, db)::Bool) | (!(lt(p.order, db, da)::Bool) & (a < b))
end

_ord(lt::typeof(isless), by::typeof(identity), order::Ordering) = order
Expand Down

0 comments on commit d0b6a17

Please sign in to comment.