Skip to content

Commit

Permalink
Use containes operator instead of filter + isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagranatavito committed Oct 18, 2021
1 parent 6905923 commit 6874760
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Resolve.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ extension DependencyContainer {

//if no definition registered for exact type try to find type-forwarding definition that can resolve the type
//that will actually happen only when resolving optionals
if definitions.filter({ $0.0.type == key.type }).isEmpty {
guard definitions.contains(where: { $0.0.type == key.type }) else {
return typeForwardingDefinition(forKey: key)
}
return nil
Expand Down

0 comments on commit 6874760

Please sign in to comment.