Skip to content

Comments

Fix reccomendation for LargeParameter (C++)#865

Merged
rdmarsh2 merged 2 commits intogithub:masterfrom
p-snft:large-parameter-const-reference
Feb 4, 2019
Merged

Fix reccomendation for LargeParameter (C++)#865
rdmarsh2 merged 2 commits intogithub:masterfrom
p-snft:large-parameter-const-reference

Conversation

@p-snft
Copy link
Contributor

@p-snft p-snft commented Feb 3, 2019

The previous reccomentation changed the behaviour of the code.
A user following the advice might have broken her/his code:
With call-by-value, the original parameter is not changed.
With a call-by-reference, however, it may be changed. To be sure,
nothing breaks by blindly following the advice, suggest to pass a
const reference.

The previous reccomentation changed the behaviour of the code.
A user following the advice might have broken her/his code:
With call-by-value, the original parameter is not changed.
With a call-by-reference, however, it may be changed. To be sure,
nothing breaks by blindly following the advice, suggest to pass a
const reference.
@p-snft p-snft requested a review from a team as a code owner February 3, 2019 14:45
@ghost
Copy link

ghost commented Feb 3, 2019

CLA assistant check
All committers have signed the CLA.

kevinbackhouse
kevinbackhouse previously approved these changes Feb 4, 2019
Copy link
Contributor

@kevinbackhouse kevinbackhouse left a comment

Choose a reason for hiding this comment

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

I agree. It is better to suggest passing by const reference.

@semmledocs-ac
Copy link
Contributor

LGTM

@jbj
Copy link
Contributor

jbj commented Feb 4, 2019

Thank you for the contribution. I agree that this recommendation is an improvement.

The tests failed because they depend on the alert message. I've added a commit to update the expected alert messages.

Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

LGTM, but someone else needs to review my change and merge.

@jbj jbj added the C++ label Feb 4, 2019
@rdmarsh2 rdmarsh2 merged commit 3a092fa into github:master Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants