Skip to content

Commit

Permalink
[Swift4.2] use compactMap instead
Browse files Browse the repository at this point in the history
  • Loading branch information
fxwx23 committed Oct 4, 2018
1 parent e402804 commit 74e022f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/JSONRPCKit/BatchElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal extension BatchElementProcotol {

internal func result(from objects: [Any]) -> Result<Request.Response, JSONRPCError> {
let matchedObject = objects
.flatMap { $0 as? [String: Any] }
.compactMap { $0 as? [String: Any] }
.filter { $0["id"].flatMap(Id.init) == id }
.first

Expand Down

0 comments on commit 74e022f

Please sign in to comment.