Skip to content
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

.SD could be shallow copied when no 'by' #838

Closed
arunsrinivasan opened this issue Sep 29, 2014 · 1 comment
Closed

.SD could be shallow copied when no 'by' #838

arunsrinivasan opened this issue Sep 29, 2014 · 1 comment

Comments

@arunsrinivasan
Copy link
Member

Here's the relevant SO post.

When there's no by, using:

DT[, lapply(.SD, ...), .SDcols = ...]

need not deep copy .SD.

Note: It might be a bit tricky for cases like:

ans = DT[, .SD]
# or
ans = DT[, lapply(.SD, function(x) x)]

where if no copy is made, and a sub-assign by reference is done on ans, but still we can optimise cases where we're sure.

Or add the shallow copied attribute so that we could check it on sub-assign (as discussed already).

@arunsrinivasan
Copy link
Member Author

More or less a duplicate of #617. When that's implemented, this'll be automatically taken care of.

@mattdowle mattdowle modified the milestones: v1.9.6, v1.9.8 Sep 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants