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

Eliminate dead return statement. #387

Merged
merged 1 commit into from
Jan 6, 2017
Merged

Eliminate dead return statement. #387

merged 1 commit into from
Jan 6, 2017

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Jan 5, 2017

Previously, the ipv6 variable was initialised to -1, but that value
was never read. Either it was set to 0 or 1, or the function would return
before it was read. Thus, I've changed it to uninitialised bool is_ipv4
(inverted semantics to avoid negative conditions if (!is_ipv6)).

The pack_ip_port function is a bit unfortunate, but I'm not rewriting
it until we have a binary writer (I'd be rewriting it twice).


This change is Reviewable

@Diadlo
Copy link

Diadlo commented Jan 5, 2017

:lgtm_strong:


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

Previously, the `ipv6` variable was initialised to `-1`, but that value
was never read. Either it was set to 0 or 1, or the function would return
before it was read. Thus, I've changed it to uninitialised `bool is_ipv4`
(inverted semantics to avoid negative conditions `if (!is_ipv6)`).

The `pack_ip_port` function is a bit unfortunate, but I'm not rewriting
it until we have a binary writer (I'd be rewriting it twice).
@iphydf iphydf merged commit e4d81e1 into TokTok:master Jan 6, 2017
@iphydf iphydf deleted the dead-code branch January 6, 2017 14:23
@nurupo
Copy link
Member

nurupo commented Jan 12, 2017

:lgtm_strong:


Comments from Reviewable

@iphydf iphydf added refactor Refactoring production code, eg. renaming a variable, not affecting semantics and removed code cleanup labels May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring production code, eg. renaming a variable, not affecting semantics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants