Skip to content

Commit

Permalink
clarify code a tiny bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Kelman authored and Timur Kelman committed Jul 25, 2024
1 parent 363a25d commit e9aefd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CodeConverter/CSharp/DeclarationNodeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,8 @@ public override async Task<CSharpSyntaxNode> VisitPropertyBlock(VBSyntax.Propert
var firstVbSourceToken = node.GetFirstToken();
first = first.ReplaceToken(firstCsConvertedToken, firstCsConvertedToken.WithSourceMappingFrom(firstVbSourceToken));

_additionalDeclarations.TryGetValue(node, out var members);
var last = members?.OfType<MethodDeclarationSyntax>().LastOrDefault() ?? first;
var members = _additionalDeclarations[node];
var last = members.OfType<MethodDeclarationSyntax>().LastOrDefault() ?? first;
var lastIx = members.ToList().IndexOf(last);
var lastIsFirst = lastIx < 0;
var lastCsConvertedToken = last.GetLastToken();
Expand All @@ -960,7 +960,7 @@ public override async Task<CSharpSyntaxNode> VisitPropertyBlock(VBSyntax.Propert

converted = lastIsFirst ? last : first;
if (!lastIsFirst) {
members![lastIx] = last;
members[lastIx] = last;
}
}

Expand Down

0 comments on commit e9aefd3

Please sign in to comment.