From f08eeeb210dc877951e69ef85d420c64853d17aa Mon Sep 17 00:00:00 2001 From: VSadov Date: Thu, 6 Oct 2016 16:30:03 -0700 Subject: [PATCH] tweaked some Workspace code to avoid a local variable --- .../Extensions/TypeSyntaxGeneratorVisitor.vb | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Workspaces/VisualBasic/Portable/Extensions/TypeSyntaxGeneratorVisitor.vb b/src/Workspaces/VisualBasic/Portable/Extensions/TypeSyntaxGeneratorVisitor.vb index d03c4d7baab..2f7ef6b2284 100644 --- a/src/Workspaces/VisualBasic/Portable/Extensions/TypeSyntaxGeneratorVisitor.vb +++ b/src/Workspaces/VisualBasic/Portable/Extensions/TypeSyntaxGeneratorVisitor.vb @@ -129,19 +129,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Dim hasNames = Not names.IsDefault Return SyntaxFactory.TupleType(SyntaxFactory.SeparatedList( - types.Select(Function(t, i) - Dim element As TupleElementSyntax - - If (hasNames AndAlso names(i) IsNot Nothing) Then - element = SyntaxFactory.NamedTupleElement(SyntaxFactory.IdentifierName(names(i)), - SyntaxFactory.SimpleAsClause(SyntaxFactory.Token(SyntaxKind.AsKeyword), Nothing, t.GenerateTypeSyntax())) - Else - - element = SyntaxFactory.TypedTupleElement(t.GenerateTypeSyntax()) - End If - - Return element - End Function))) + types.Select(Function(t, i) If(hasNames AndAlso names(i) IsNot Nothing, + SyntaxFactory.NamedTupleElement( + SyntaxFactory.IdentifierName(names(i)), + SyntaxFactory.SimpleAsClause( + SyntaxFactory.Token(SyntaxKind.AsKeyword), + Nothing, + t.GenerateTypeSyntax())), + DirectCast(SyntaxFactory.TypedTupleElement( + t.GenerateTypeSyntax()), TupleElementSyntax))))) End Function Public Overrides Function VisitNamedType(symbol As INamedTypeSymbol) As TypeSyntax -- GitLab