Skip to content

Commit 96fffa9

Browse files
authored
Shrink ValueSymbolLinks by 16 bytes (#64739)
1 parent bdc93bd commit 96fffa9

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎tsc/internal/checker/checker.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ type Checker struct {
647647
iterationTypesCache map[IterationTypesKey]IterationTypes
648648
markerTypes collections.Set[*Type]
649649
resolvingExplicitTypeOfSymbol collections.Set[*ast.Symbol]
650+
constructorOrFunctionChecked collections.Set[*ast.Symbol]
650651
undefinedSymbol *ast.Symbol
651652
argumentsSymbol *ast.Symbol
652653
requireSymbol *ast.Symbol
@@ -3492,8 +3493,7 @@ func (c *Checker) checkFunctionOrMethodDeclaration(node *ast.Node) {
34923493

34933494
func (c *Checker) checkFunctionOrConstructorSymbol(symbol *ast.Symbol) {
34943495
// Only check the symbol once
3495-
if links := c.valueSymbolLinks.Get(symbol); !links.functionOrConstructorChecked {
3496-
links.functionOrConstructorChecked = true
3496+
if c.constructorOrFunctionChecked.AddIfAbsent(symbol) {
34973497
c.checkFunctionOrConstructorSymbolWorker(symbol)
34983498
}
34993499
}

‎tsc/internal/checker/types.go‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,12 @@ type SymbolReferenceLinks struct {
180180
// Links for value symbols
181181

182182
type ValueSymbolLinks struct {
183-
resolvedType *Type // Type of value symbol
184-
writeType *Type
185-
target *ast.Symbol
186-
mapper *TypeMapper
187-
nameType *Type
188-
containingType *Type // Mapped type for mapped type property, containing union or intersection type for synthetic property
189-
functionOrConstructorChecked bool
183+
resolvedType *Type // Type of value symbol
184+
writeType *Type
185+
target *ast.Symbol
186+
mapper *TypeMapper
187+
nameType *Type
188+
containingType *Type // Mapped type for mapped type property, containing union or intersection type for synthetic property
190189
}
191190

192191
// Additional links for mapped symbols

0 commit comments

Comments
 (0)