Skip to content

Commit

Permalink
Drive-by microopt - remove duplicated subtype query (#46560)
Browse files Browse the repository at this point in the history
`typeintersect` already performs this subtype query internally
as the first thing it does, so just check after the fact rather
than duplicating the query.
  • Loading branch information
Keno authored Aug 31, 2022
1 parent 8adca3b commit 5a02f3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/compiler/typelattice.jl
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ function tmeet(@nospecialize(v), @nospecialize(t::Type))
elseif isa(v, PartialStruct)
has_free_typevars(t) && return v
widev = widenconst(v)
if widev <: t
ti = typeintersect(widev, t)
if ti === widev
return v
end
ti = typeintersect(widev, t)
valid_as_lattice(ti) || return Bottom
@assert widev <: Tuple
new_fields = Vector{Any}(undef, length(v.fields))
Expand Down

0 comments on commit 5a02f3f

Please sign in to comment.