Skip to content

Commit

Permalink
simplified InheritInfoFromDependencyOwner #632
Browse files Browse the repository at this point in the history
  • Loading branch information
dadhi committed Mar 8, 2024
1 parent 7988890 commit 4697be1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DryIoc/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9569,8 +9569,7 @@ public static ServiceDetails OfValue(object value) =>
/// <summary>Sets the service key as a detials of the service resolution.</summary>
[MethodImpl((MethodImplOptions)256)]
public static ServiceDetails OfServiceKey(object serviceKey) =>
new ServiceDetails(null, IfUnresolved.Throw, serviceKey, null, null, null,
hasCustomValue: false);
new ServiceDetails(null, IfUnresolved.Throw, serviceKey, null, null, null, hasCustomValue: false);

/// <summary>Creates new details out of provided settings and not null `serviceKey`.</summary>
[MethodImpl((MethodImplOptions)256)]
Expand Down Expand Up @@ -9794,10 +9793,11 @@ public static object InheritInfoFromDependencyOwner(this Type serviceType,
if (serviceType == requiredServiceType)
requiredServiceType = null;

if (serviceKey == null & requiredServiceType == null & metadataKey == null & metadata == null & ifUnresolved == IfUnresolved.Throw)
if (requiredServiceType == null & serviceKey == null & metadataKey == null & metadata == null & ifUnresolved == IfUnresolved.Throw)
return serviceType;

return ServiceInfo.Of(serviceType, ServiceDetails.Of(requiredServiceType, serviceKey, ifUnresolved, null, metadataKey, metadata));
var details = new ServiceDetails(requiredServiceType, ifUnresolved, serviceKey, metadataKey, metadata, null, hasCustomValue: false);
return ServiceInfo.Of(serviceType, details);
}

/// <summary>Returns required service type if it is specified and assignable to service type,
Expand Down

0 comments on commit 4697be1

Please sign in to comment.