Skip to content

Commit

Permalink
added todos
Browse files Browse the repository at this point in the history
  • Loading branch information
dadhi committed Oct 8, 2021
1 parent a3ac423 commit 37530d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DryIoc.MefAttributedModel/AttributedModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static IContainer WithMultipleSameContractNamesSupport(this IContainer co

internal static IEnumerable<T> FilterCollectionByMultiKey<T>(IEnumerable<KeyValuePair<object, T>> 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)
Expand Down
8 changes: 4 additions & 4 deletions src/DryIoc/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));

Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 37530d5

Please sign in to comment.