Skip to content

Commit

Permalink
Reduce calls to Crystal::Type#remove_indirection in module dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Sep 10, 2024
1 parent cdd9ccf commit d15d9ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/compiler/crystal/codegen/call.cr
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ class Crystal::CodeGenVisitor

is_super = node.super?

# call `#remove_indirection` here so that the `match_type_id` below doesn't
# spend time expanding module types again and again
owner = owner.remove_indirection unless is_super

with_cloned_context do
context.vars = new_vars

Expand Down

0 comments on commit d15d9ba

Please sign in to comment.