From cc6ad21f6e19386f7e152568258139a4bad22631 Mon Sep 17 00:00:00 2001 From: sven-n Date: Fri, 27 Oct 2023 21:26:31 +0200 Subject: [PATCH] Removed unneeded parameters --- src/GameLogic/ConfigurationChangeMediator.cs | 4 ++-- src/SourceGenerators/CloneableGenerator.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/GameLogic/ConfigurationChangeMediator.cs b/src/GameLogic/ConfigurationChangeMediator.cs index 3526c14ee..3d0a9a715 100644 --- a/src/GameLogic/ConfigurationChangeMediator.cs +++ b/src/GameLogic/ConfigurationChangeMediator.cs @@ -52,8 +52,8 @@ public IDisposable RegisterObject(TConfig config, T obj, Func)this._registrations.AddOrUpdate( config.GetId(), - key => new ChangeRegistration(config), - (key, value) => value); + _ => new ChangeRegistration(config), + (_, value) => value); if (onChange is not null) { diff --git a/src/SourceGenerators/CloneableGenerator.cs b/src/SourceGenerators/CloneableGenerator.cs index 84792d795..a0a05f036 100644 --- a/src/SourceGenerators/CloneableGenerator.cs +++ b/src/SourceGenerators/CloneableGenerator.cs @@ -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) { @@ -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().Where(p => p.SetMethod is not null)) {