From 37530d569b4f6ebe5f687dff63ff643f4f98f8c0 Mon Sep 17 00:00:00 2001 From: dadhi Date: Sat, 9 Oct 2021 00:10:30 +0300 Subject: [PATCH] added todos --- src/DryIoc.MefAttributedModel/AttributedModel.cs | 2 +- src/DryIoc/Container.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DryIoc.MefAttributedModel/AttributedModel.cs b/src/DryIoc.MefAttributedModel/AttributedModel.cs index 6f436fb1..1addb2dc 100644 --- a/src/DryIoc.MefAttributedModel/AttributedModel.cs +++ b/src/DryIoc.MefAttributedModel/AttributedModel.cs @@ -262,7 +262,7 @@ public static IContainer WithMultipleSameContractNamesSupport(this IContainer co internal static IEnumerable FilterCollectionByMultiKey(IEnumerable> source, object serviceKey) => serviceKey == null - ? source.Select(x => x.Value) + ? source.Select(x => x.Value) // todo: @perf optimize : source.Where(x => { if (x.Key is DefaultKey || x.Key is DefaultDynamicKey) diff --git a/src/DryIoc/Container.cs b/src/DryIoc/Container.cs index 6edd87ba..8c126d6a 100644 --- a/src/DryIoc/Container.cs +++ b/src/DryIoc/Container.cs @@ -1466,7 +1466,7 @@ Expression IContainer.GetDecoratorExpressionOrDefault(Request request) var arrayElementType = request.ServiceType.GetArrayElementTypeOrNull(); if (arrayElementType != null) - request = request.WithChangedServiceInfo(x => + request = request.WithChangedServiceInfo(x => // todo: @perf optimize allocations x.With(typeof(IEnumerable<>).MakeGenericType(arrayElementType))); var serviceType = request.ServiceType; @@ -1510,7 +1510,7 @@ Expression IContainer.GetDecoratorExpressionOrDefault(Request request) // Append generic type argument decorators, registered as Object // Note: the condition for type arguments should be checked before generating the closed generic version - var typeArgDecorators = container.GetDecoratorFactoriesOrDefault(typeof(object)); + var typeArgDecorators = container.GetDecoratorFactoriesOrDefault(typeof(object)); // todo: @perf add the rule for the object decorator to speedup the check if (!typeArgDecorators.IsNullOrEmpty()) genericDecorators = genericDecorators.Append(typeArgDecorators.Match(request, (r, d) => d.CheckCondition(r))); @@ -10712,13 +10712,13 @@ public static PropertiesAndFieldsSelector All( return req => { - var properties = req.ImplementationType.GetMembers(x => x.DeclaredProperties, includeBase: withBase) + var properties = req.ImplementationType.GetMembers(x => x.DeclaredProperties, includeBase: withBase) // todo: @perf optimize allocations .Match(p => p.IsInjectable(withNonPublic, withPrimitive), p => info(p, req)); if (!withFields) return properties; - var fields = req.ImplementationType + var fields = req.ImplementationType // todo: @perf optimize allocations and maybe combine with properties .GetMembers(x => x.DeclaredFields, includeBase: withBase) .Match(f => f.IsInjectable(withNonPublic, withPrimitive), f => info(f, req));