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

Remove redundant optional unwrap #2056

Merged
merged 1 commit into from Jun 16, 2017

Conversation

Projects
None yet
2 participants
@dusek
Contributor

dusek commented Apr 1, 2017

self[task] is guarded a few lines above to not be nil (and captured in request variable), so checking again whether it is nil a few lines later is confusing because it suggests that it could be nil, which cannot be the case however.

This is based on the assumption that validations run a few lines above do not set the delegate of the request to nil.

@dusek

This comment has been minimized.

Show comment
Hide comment
@dusek

dusek Apr 3, 2017

Contributor

Rebased on latest master.

Contributor

dusek commented Apr 3, 2017

Rebased on latest master.

Remove redundant optional unwrap
`self[task]` is guarded a few lines above to not be `nil` (and
captured in `request` variable), so checking again whether it is `nil`
a few lines later is confusing because it suggests that it could be
`nil`, which cannot be the case however.

This is based on the assumption that validations do not set the
delegate of the `request` to `nil`.
@cnoon

This comment has been minimized.

Show comment
Hide comment
@cnoon

cnoon Jun 16, 2017

Member

Thanks for putting this together @dusek...much appreciated! 🍻

Member

cnoon commented Jun 16, 2017

Thanks for putting this together @dusek...much appreciated! 🍻

@cnoon cnoon self-assigned this Jun 16, 2017

@cnoon cnoon added the enhancement label Jun 16, 2017

@cnoon cnoon added this to the 4.5.0 milestone Jun 16, 2017

@cnoon

cnoon approved these changes Jun 16, 2017

@cnoon cnoon merged commit c1620fc into Alamofire:master Jun 16, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment