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

Do not use else after return. #78

Merged
merged 1 commit into from
Sep 2, 2016
Merged

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Aug 31, 2016

@JFreegman
Copy link
Member

:lgtm:


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


Comments from Reviewable

@iphydf iphydf force-pushed the else-after-return branch 2 times, most recently from 2250f63 to 79d6cc1 Compare September 1, 2016 18:48
@nurupo
Copy link
Member

nurupo commented Sep 2, 2016

Reviewed 1 of 31 files at r1, 23 of 23 files at r2.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


toxcore/DHT.c, line 2507 [r2] (raw file):

            return dht->cryptopackethandlers[number].function(dht->cryptopackethandlers[number].object, source, public_key,
                    data, len);
        } /* If request is not for us, try routing it. */

Move the comment one line lower?


toxcore/net_crypto.c, line 1396 [r2] (raw file):

        } else {
            //TODO?
        }

I think that else part has to stay for the 'TODO' to make sense.


toxcore/net_crypto.c, line 1543 [r2] (raw file):

            }

            return 0;

That's interesting. Looks like some logic error with that unnecessary return 0, or someone just forgot to remove it while extending code.


Comments from Reviewable

@nurupo
Copy link
Member

nurupo commented Sep 2, 2016

Reviewed 7 of 31 files at r1.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Sep 2, 2016

Review status: all files reviewed at latest revision, 3 unresolved discussions.


toxcore/DHT.c, line 2507 [r2] (raw file):

Previously, nurupo wrote…

Move the comment one line lower?

Done.

toxcore/net_crypto.c, line 1396 [r2] (raw file):

Previously, nurupo wrote…

I think that else part has to stay for the 'TODO' to make sense.

Does the TODO make sense?

Comments from Reviewable

@iphydf iphydf force-pushed the else-after-return branch 2 times, most recently from c475aba to a9e5861 Compare September 2, 2016 08:57
@nurupo
Copy link
Member

nurupo commented Sep 2, 2016

Reviewed 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


toxcore/net_crypto.c, line 1396 [r2] (raw file):

Previously, iphydf wrote…

Does the TODO make sense?

Can't we just keep the `} else { // TODO? }`? It's not obvious that with `// else TODO?` you mean the `else` of the if-statement above, at least to me it's not.

Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Sep 2, 2016

Review status: 29 of 31 files reviewed at latest revision, 2 unresolved discussions.


toxcore/net_crypto.c, line 1396 [r2] (raw file):

Previously, nurupo wrote…

Can't we just keep the } else { // TODO? }? It's not obvious that with // else TODO? you mean the else of the if-statement above, at least to me it's not.

How about this?

Comments from Reviewable

@nurupo
Copy link
Member

nurupo commented Sep 2, 2016

:lgtm:


Reviewed 2 of 2 files at r4.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@iphydf iphydf closed this Sep 2, 2016
@iphydf iphydf deleted the else-after-return branch September 2, 2016 12:36
@iphydf iphydf merged commit a9fbdaf into TokTok:master Sep 2, 2016
iphydf added a commit to iphydf/c-toxcore that referenced this pull request Sep 12, 2016
iphydf added a commit to iphydf/c-toxcore that referenced this pull request Sep 12, 2016
@iphydf iphydf modified the milestone: v0.0.1 Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants