-
Notifications
You must be signed in to change notification settings - Fork 26
Simplify foreach loop by using LINQ Select #723
Copy link
Copy link
Labels
C#C# related codeC# related codeMaintainabilitybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
What version of FlowSynx?
1.2.4
Describe the bug
The loop is only used to extract jwt.Name and log it. This can be simplified using LINQ (Select) to improve readability and reduce boilerplate.
File: src/FlowSynx.Application/Configuration/Core/Security/AuthenticationConfiguration.cs
Line: 41-45
Current Code:
foreach (var jwt in JwtProviders)
{
validSchemes.Add(jwt.Name);
logger.LogInformation("JWT provider '{Scheme}' configured", jwt.Name);
}Proposed Fix
foreach (var scheme in JwtProviders.Select(jwt => jwt.Name))
{
validSchemes.Add(scheme);
logger.LogInformation("JWT provider '{Scheme}' configured", scheme);
}Benefits
- Cleaner and more expressive
- Reduces unnecessary direct iteration over provider objects
- Makes intent (extracting names) more obvious
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C#C# related codeC# related codeMaintainabilitybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed