Skip to content

Commit 70bfa3f

Browse files
authored
improve type stability of lt(p::Perm, a::Integer, b::Integer) (#46732)
This fixes a few hundred invalidations when loading Static/jl/ArrayInterface.jl.
1 parent df955b8 commit 70bfa3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/ordering.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ lt(o::Lt, a, b) = o.lt(a,b)
122122
@propagate_inbounds function lt(p::Perm, a::Integer, b::Integer)
123123
da = p.data[a]
124124
db = p.data[b]
125-
lt(p.order, da, db) | (!lt(p.order, db, da) & (a < b))
125+
(lt(p.order, da, db)::Bool) | (!(lt(p.order, db, da)::Bool) & (a < b))
126126
end
127127

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

0 commit comments

Comments
 (0)