Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Ubdate to Swift 5.0 #1066

wants to merge 1 commit into from

Conversation

savoptik
Copy link

I updated the code to Swift 5.0

@@ -272,7 +272,7 @@ public extension Mapper where N: ImmutableMappable {
#if swift(>=4.1)
return try JSONArray.compactMap(mapOrFail)
#else
return try JSONArray.flatMap(mapOrFail)
return try JSONArray.compactMap(mapOrFail)
Copy link
Contributor

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 now if and else blocks has same actions.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

Please just remove else statement if it is necessary because now if and else blocks has same actions.

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.
Please just remove else statement if it is necessary because now if and else blocks has same actions.

@@ -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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.
Please just remove else statement if it is necessary because now if and else blocks has same actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants