-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubdate to Swift 5.0 #1066
base: master
Are you sure you want to change the base?
Ubdate to Swift 5.0 #1066
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ public final class Map { | |
#if swift(>=4.1) | ||
return v.compactMap{ Float($0) } as? T | ||
#else | ||
return v.flatMap{ Float($0) } as? T | ||
return v.compactMap{ Float($0) } as? T | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. Please just remove |
||
#endif | ||
} | ||
} else if value == nil && T.self == [String:Float].self { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,7 +165,7 @@ public final class Mapper<N: BaseMappable> { | |
#if swift(>=4.1) | ||
let result = JSONArray.compactMap(map) | ||
#else | ||
let result = JSONArray.flatMap(map) | ||
let result = JSONArray.compactMap(map) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
#endif | ||
return result | ||
} | ||
|
@@ -433,7 +433,7 @@ extension Mapper where N: Hashable { | |
#if swift(>=4.1) | ||
return Set(JSONArray.compactMap(map)) | ||
#else | ||
return Set(JSONArray.flatMap(map)) | ||
return Set(JSONArray.compactMap(map)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
#endif | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just remove
else
statement if it is necessary because nowif
andelse
blocks has same actions.