refactor: simplify lambda

This PR refactors a lambda expression that contained unnecessary braces around a single-statement body, converting it into a more concise expression-bodied form to improve readability and maintainability.

- Consider simplifying lambda when its body has a single statement: The original lambda used a block body with braces and a single call to Execute, which is verbose for a one-line operation. We removed the braces and semicolon, converting it into an expression-bodied lambda (`static (spc, pair) => Execute(spc, pair.Left, pair.Right)`) to simplify the code and follow best practices.

> This Autofix was generated by AI. Please review the change before merging.
This commit is contained in:
deepsource-autofix[bot] 2026-03-22 14:49:35 +00:00 committed by gewuyou
parent cf486cbeff
commit c70728b64e

View File

@ -38,7 +38,7 @@ public sealed class GetNodeGenerator : IIncrementalGenerator
var compilationAndCandidates = context.CompilationProvider.Combine(candidates.Collect());
context.RegisterSourceOutput(compilationAndCandidates,
static (spc, pair) => { Execute(spc, pair.Left, pair.Right); });
static (spc, pair) => Execute(spc, pair.Left, pair.Right));
}
private static bool IsCandidate(SyntaxNode node)