Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,7 @@ setalloccol = alloc.col = function(DT, n=getOption("datatable.alloccol"), verbos
name = as.character(name)
assign(name,ans,parent.frame(),inherits=TRUE)
}
.Call(Csetmutable,ans)
ans
}

selfrefok = function(DT,verbose=getOption("datatable.verbose")) {
Expand Down
4 changes: 2 additions & 2 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -1496,8 +1496,8 @@ DT = data.table(a=3:1,b=4:6)
test(506, key(DT)<-"a", "a", warning="deprecated")
test(508, DT, data.table(a=1:3,b=6:4,key="a"))
test(509, DT[,b:=10L], data.table(a=1:3,b=10L,key="a"))
test(510, DT[,c:=11L], data.table(a=1:3,b=10L,c=11L,key="a")) # Used to be warning about invalid .internal.selfref detected and fixed. As from v1.8.3 data.table() returns a NAMED==0 object, and key<- appears not to copy that. But within functions, key<- would still copy. TO DO: add tests....
#test(511,)
test(510, DT[,c:=11L], data.table(a=1:3,b=10L,c=11L,key="a"), # no warning between 1.8.3 and 1.12.2 due to (now removed) setmutable and SET_NAMED in setalloccol, #3729
warning="Invalid .internal.selfref detected and fixed") # but the warning makes sense after the (deprecated) key(DT)<- above, so this warns again from 1.12.4

# Test new functons chmatch and %chin%
y=letters
Expand Down
2 changes: 0 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ SEXP reorder();
SEXP rbindlist();
SEXP vecseq();
SEXP setlistelt();
SEXP setmutable();
SEXP address();
SEXP expandAltRep();
SEXP fmelt();
Expand Down Expand Up @@ -111,7 +110,6 @@ R_CallMethodDef callMethods[] = {
{"Crbindlist", (DL_FUNC) &rbindlist, -1},
{"Cvecseq", (DL_FUNC) &vecseq, -1},
{"Csetlistelt", (DL_FUNC) &setlistelt, -1},
{"Csetmutable", (DL_FUNC) &setmutable, -1},
{"Caddress", (DL_FUNC) &address, -1},
{"CexpandAltRep", (DL_FUNC) &expandAltRep, -1},
{"Cfmelt", (DL_FUNC) &fmelt, -1},
Expand Down
8 changes: 0 additions & 8 deletions src/wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ SEXP setlistelt(SEXP l, SEXP i, SEXP value)
return(R_NilValue);
}

SEXP setmutable(SEXP x)
{
// called from one single place at R level. TODO: avoid somehow, but fails tests without
// At least the SET_NAMED() direct call is passed 0 and makes no assumptions about >0. Good enough for now as patch for CRAN is needed.
SET_NAMED(x,0);
return(x);
}

SEXP address(SEXP x)
{
// A better way than : http://stackoverflow.com/a/10913296/403310
Expand Down