Skip to content

Conversation

savoptik
Copy link

I updated the code to Swift 5.0

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.

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.

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.

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