Skip to content

Commit 5a02f3f

Browse files
authored
Drive-by microopt - remove duplicated subtype query (#46560)
`typeintersect` already performs this subtype query internally as the first thing it does, so just check after the fact rather than duplicating the query.
1 parent 8adca3b commit 5a02f3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/compiler/typelattice.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ function tmeet(@nospecialize(v), @nospecialize(t::Type))
395395
elseif isa(v, PartialStruct)
396396
has_free_typevars(t) && return v
397397
widev = widenconst(v)
398-
if widev <: t
398+
ti = typeintersect(widev, t)
399+
if ti === widev
399400
return v
400401
end
401-
ti = typeintersect(widev, t)
402402
valid_as_lattice(ti) || return Bottom
403403
@assert widev <: Tuple
404404
new_fields = Vector{Any}(undef, length(v.fields))

0 commit comments

Comments
 (0)