Skip to content

Commit 48ef7f9

Browse files
committed
Edits based on guidance from @MichaelChirico
1 parent f08502c commit 48ef7f9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

R/tables.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type_size = function(DT) {
55
# for speed and ram efficiency, a lower bound by not descending into character string lengths or list items
66
# if a more accurate and higher estimate is needed then user can pass object.size or alternative to mb=
77
# in case number of columns is very large (e.g. 1e6 columns) then we use a for() to avoid allocation of sapply()
8-
ans = 0
8+
ans = 0.0
99
lookup = c("raw"=1L, "integer"=4L, "double"=8L, "complex"=16L)
1010
for (i in seq_along(DT)) {
1111
col = DT[[i]]

inst/tests/other.Rraw

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,8 @@ if (loaded[["nanotime"]]) {
768768
}
769769

770770
# test for bug#6607
771-
local({
772-
DT <- as.data.table(lapply(1:15,function(i) runif(20e6)))
773-
res <- tables()
774-
data.table:::test(32, res[NAME=='DT',.(NAME,NROW,NCOL,MB)], data.table(NAME="DT",NROW=20000000L,NCOL=15L,MB=2288))
775-
})
771+
.e <- new.env() ## to not populate the .GlobalEnv
772+
.e[["DT"]] <- as.data.table(lapply(1:15,function(i) runif(20e6)))
773+
res <- tables(env=.e)
774+
test(32, res[, .(NAME,NROW,NCOL,MB)], data.table(NAME="DT",NROW=20000000L,NCOL=15L,MB=2288))
775+
rm(.e, res)

0 commit comments

Comments
 (0)