Skip to content

Commit 6874760

Browse files
Use containes operator instead of filter + isEmpty
1 parent 6905923 commit 6874760

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/Resolve.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ extension DependencyContainer {
253253

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

0 commit comments

Comments
 (0)