Skip to content

Commit

Permalink
Use CastUp in VB implementation to improve downstream performance
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Aug 3, 2024
1 parent d5ebaf2 commit 72b1e15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols

Private ReadOnly Property IAssemblySymbol_Modules As IEnumerable(Of IModuleSymbol) Implements IAssemblySymbol.Modules
Get
Return Me.Modules
Return ImmutableArray(Of IModuleSymbol).CastUp(Me.Modules)
End Get
End Property

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ protected sealed override SymbolKeyResolution Resolve(
}
else
{
// Visual Basic implementation of IAssemblySymbol.Modules relies on covariance of IEnumerable<T>, so
// the preceding concrete type check will fail.
// Otherwise fall back to generic enumeration
result.AddValuesIfNotNull(assemblyModules);
}
}
Expand Down

0 comments on commit 72b1e15

Please sign in to comment.