From f1fb9b57a0cd79c00f3854406310a81455696d30 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 2 Feb 2025 10:27:31 +0000 Subject: [PATCH] Removed variable assignment --- .../DependencyInjectionRegistrator.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Libraries/SptDependencyInjection/DependencyInjectionRegistrator.cs b/Libraries/SptDependencyInjection/DependencyInjectionRegistrator.cs index 6b6dd7b4..ecfd14ef 100644 --- a/Libraries/SptDependencyInjection/DependencyInjectionRegistrator.cs +++ b/Libraries/SptDependencyInjection/DependencyInjectionRegistrator.cs @@ -19,11 +19,10 @@ public static class DependencyInjectionRegistrator public static void RegisterComponents(IServiceCollection builderServices, IEnumerable types) { var groupedTypes = types.SelectMany( - t => + registerableType => { - var attributes = (Injectable[])Attribute.GetCustomAttributes(t, typeof(Injectable)); - var registerableType = t; - var registerableComponents = new List(); + var attributes = (Injectable[])Attribute.GetCustomAttributes(registerableType, typeof(Injectable)); + var registerableComponentsResult = new List(); foreach (var attribute in attributes) { // if we have a type override this takes priority @@ -37,10 +36,10 @@ public static class DependencyInjectionRegistrator registerableType = registerableType.GetInterfaces()[0]; } - registerableComponents.Add(new RegisterableType(registerableType, t, attribute)); + registerableComponentsResult.Add(new RegisterableType(registerableType, registerableType, attribute)); } - return registerableComponents; + return registerableComponentsResult; } ) .GroupBy(t => t.RegisterableInterface.FullName);