Skip to content

Optimize removing negligible values #688

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

Conversation

pkierski
Copy link
Contributor

@pkierski pkierski commented Oct 5, 2017

Sometimes I don't care about removed value, so it will be easier just forget it (and not need to add local variable for it).

@BillyDonahue
Copy link
Contributor

Another option that I'd prefer would be to add a single-argument overload of removeValue that doesn't have the pointer at all. Then you have more expressive call sites, we don't talk about NULL in the docs, and we skip a conditional.

@@ -534,6 +534,7 @@ Json::Value obj_value(Json::objectValue); // {}
/** \brief Remove the named map member.

Update 'removed' iff removed.
'removed' can be NULL if removed value is negligible.
Copy link
Contributor

@BillyDonahue BillyDonahue Oct 5, 2017

Choose a reason for hiding this comment

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

The word "negligible" is almost misused here as it implies a small size. The removed value might be ignorable, but not because of its size. Ignorable would be a more plain choice. But see other comments as I think this optionally-null parameter isn't the best choice.

@wolframroesler
Copy link
Contributor

Seems to be identical to a PR I suggested some weeks ago: #689

It was rejected, the following solution was accepted instead: #693

@cdunn2001
Copy link
Contributor

If @wolframroesler is right, can we close this PR?

@hjmjohnson
Copy link
Contributor

Alternate solution accepted in solution was accepted instead: #693.

@hjmjohnson hjmjohnson closed this Jan 11, 2019
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.

5 participants