Skip to content

Commit

Permalink
improve type stability of lt(p::Perm, a::Integer, b::Integer) (#46732)
Browse files Browse the repository at this point in the history
This fixes a few hundred invalidations when loading Static/jl/ArrayInterface.jl.

(cherry picked from commit 70bfa3f)
  • Loading branch information
ranocha authored and KristofferC committed Sep 16, 2022
1 parent 2aaded9 commit 3d8b92f
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 3d8b92f

Please sign in to comment.