extract common code of growVector and copyAsPlain into helper#7602
extract common code of growVector and copyAsPlain into helper#7602ben-schwen merged 6 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7602 +/- ##
==========================================
+ Coverage 99.00% 99.02% +0.02%
==========================================
Files 87 87
Lines 16893 16890 -3
==========================================
+ Hits 16725 16726 +1
+ Misses 168 164 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Generated via commit 4afc587 Download link for the artifact containing the test results: ↓ atime-results.zip
|
|
According to As a minor improvement, it may be worth switching this bit of code from |
| default : // # nocov | ||
| internal_error(__func__, "type '%s' not supported", type2char(TYPEOF(x))); // # nocov | ||
| } | ||
| copyVectorElements(newx, x, (R_xlen_t)len, false, __func__); |
There was a problem hiding this comment.
| copyVectorElements(newx, x, (R_xlen_t)len, false, __func__); | |
| copyVectorElements(newx, x, (R_xlen_t)len, /*deep_copy=*/false, __func__); |
inspiration: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html
MichaelChirico
left a comment
There was a problem hiding this comment.
I think the slight added complication for the "rarer" VECSXP case is worth it for the unified logic of the common atomic vector cases.
Co-authored-by: Michael Chirico <chiricom@google.com>
Co-authored-by: Michael Chirico <chiricom@google.com>

Closes #6908
It dedoubles the code, but due to the recursive call of
copyAsPlain, I'm not sure its really cleaner.Maybe we should add a comment in both functions, linking to each other to not forget updating the code of one, if we update code of the other, and close the issue?