Skip to content

Commit

Permalink
Removed unneeded parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Oct 27, 2023
1 parent 4417451 commit cc6ad21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/GameLogic/ConfigurationChangeMediator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public IDisposable RegisterObject<TConfig, T>(TConfig config, T obj, Func<Action
{
var registration = (ChangeRegistration<TConfig>)this._registrations.AddOrUpdate(
config.GetId(),
key => new ChangeRegistration<TConfig>(config),
(key, value) => value);
_ => new ChangeRegistration<TConfig>(config),
(_, value) => value);

if (onChange is not null)
{
Expand Down
5 changes: 2 additions & 3 deletions src/SourceGenerators/CloneableGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void Execute(GeneratorExecutionContext context)
continue;
}

var attributeClass = semanticModel.GetTypeInfo(nodes.Last().Parent!);
var declaredClassSymbol = semanticModel.GetDeclaredSymbol(declaredClass);
if (declaredClassSymbol is null)
{
Expand Down Expand Up @@ -127,13 +126,13 @@ public virtual void AssignValuesOf({{className}} other, GameConfiguration gameCo
sb.AppendLine(" base.AssignValuesOf(other, gameConfiguration);");
}

this.GenerateAssignments(sb, annotatedClass, declaredClassSymbol);
this.GenerateAssignments(sb, declaredClassSymbol);
sb.AppendLine(" }");
sb.AppendLine("}");
return sb;
}

private void GenerateAssignments(StringBuilder sb, ClassDeclarationSyntax annotatedClass, INamedTypeSymbol declaredClassSymbol)
private void GenerateAssignments(StringBuilder sb, INamedTypeSymbol declaredClassSymbol)
{
foreach (var property in declaredClassSymbol.GetMembers().OfType<IPropertySymbol>().Where(p => p.SetMethod is not null))
{
Expand Down

0 comments on commit cc6ad21

Please sign in to comment.