r3.univar: Bring r3.univar implementation closer to r.univar #5939
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This isn't much, but I happened to see when looking why there were some differences in the strings used between r and r3 versions of some code, that the implementations were more diverging than only what is needed for handling the third dimension.
I had the two files compared, side by side, and with moved blocks detection enabled to see.
Some parts of r3 had more understandable variable names, whilst the r version had gui section tags that I copied over to the r3 version.
There was a static function "univar_stat_with_percentiles" in r.univar that I would've like to use as is in the r3 version, but since it is "static", it doesn't work to define it in another file. Is duplicating that function the correct approach?
I've read about the
sizeof(type)
vssizeof expression
, and kinda concluded that it doesn't really matter to parenthesize an expression. I verified a sample little program on Godbolt: https://godbolt.org/z/Wc31Pboqx