mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 11:14:30 +08:00
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:
parent
cf486cbeff
commit
c70728b64e
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user