-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand altrep in assign #5401
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
Merged
Merged
Expand altrep in assign #5401
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
62f274a
Check for ALTREP
tlapak ea1e5af
Fix and add tests
tlapak d8266c5
NEWS Item
tlapak 871deb2
Merge branch 'master' into expand_ALTREP_in_assign
MichaelChirico 2c9f3bd
Merge branch 'master' into expand_ALTREP_in_assign
MichaelChirico 201a1f8
add a new forward-compatibility test
MichaelChirico aab8714
pass for stlye
MichaelChirico 6777191
comment
MichaelChirico 6d257f5
clarify we think this is rare given the lack of related issues
MichaelChirico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -498,11 +498,12 @@ SEXP assign(SEXP dt, SEXP rows, SEXP cols, SEXP newcolnames, SEXP values) | |
| if (length(rows)==0 && targetlen==vlen && (vlen>0 || nrow==0)) { | ||
| if ( MAYBE_SHARED(thisvalue) || // set() protects the NAMED of atomic vectors from .Call setting arguments to 2 by wrapping with list | ||
| (TYPEOF(values)==VECSXP && i>LENGTH(values)-1) || // recycled RHS would have columns pointing to others, #185. | ||
| (TYPEOF(values)!=VECSXP && i>0) // assigning the same values to a second column. Have to ensure a copy #2540 | ||
| (TYPEOF(values)!=VECSXP && i>0) || // assigning the same values to a second column. Have to ensure a copy #2540 | ||
| ALTREP(thisvalue) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a comment here on why this test exists would be appropriate IMO |
||
| ) { | ||
| if (verbose) { | ||
| Rprintf(_("RHS for item %d has been duplicated because NAMED==%d MAYBE_SHARED==%d, but then is being plonked. length(values)==%d; length(cols)==%d)\n"), | ||
| i+1, NAMED(thisvalue), MAYBE_SHARED(thisvalue), length(values), length(cols)); | ||
| Rprintf(_("RHS for item %d has been duplicated because NAMED==%d MAYBE_SHARED==%d ALTREP==%d, but then is being plonked. length(values)==%d; length(cols)==%d)\n"), | ||
| i+1, NAMED(thisvalue), MAYBE_SHARED(thisvalue), ALTREP(thisvalue), length(values), length(cols)); | ||
| } | ||
| thisvalue = copyAsPlain(thisvalue); // PROTECT not needed as assigned as element to protected list below. | ||
| } else { | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be more specific? "did not always", well, when?
Trying to put myself in the shoes of a user scanning the NEWS for bugs that might affect me, this one might seem "scary" without more clarity.