Skip to content

Commit e12425f

Browse files
committed
address issues spot by lintr
1 parent 03980b2 commit e12425f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

R/froll.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ froll = function(fun, x, n, fill=NA, algo=c("fast","exact"), align=c("right","le
116116
if (!missing(hasNA)) {
117117
if (!is.na(has.nf))
118118
stopf("hasNA is deprecated, use has.nf instead")
119-
warning("hasNA is deprecated, use has.nf instead")
119+
warningf("hasNA is deprecated, use has.nf instead")
120120
has.nf = hasNA
121121
} # remove check on next major release
122122
algo = match.arg(algo)

R/frollapply.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","
226226
} else {
227227
#has.growable = base::getRversion() >= "3.4.0"
228228
## this is now always TRUE
229-
## we keep this branch, it may be useful when getting rid of SET_GROWABLE_BIT and SETLENGTH
230-
has.growable = getOption("datatable.debug.frollapply.nogrowable", TRUE)
229+
## we keep this branch, it may be useful when getting rid of SET_GROWABLE_BIT and SETLENGTH #6180
230+
has.growable = TRUE
231231
cpy = if (has.growable) function(x) .Call(Csetgrowable, copy(x)) else copy
232232
ansMask = function(len, n) {
233233
mask = seq_len(len) >= n
@@ -239,7 +239,7 @@ frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","
239239
if (has.growable) {
240240
tight = function(i, dest, src, n) FUN(.Call(CmemcpyVectoradaptive, dest, src, i, n), ...)
241241
} else {
242-
tight = function(i, dest, src, n) FUN(src[(i-n[i]+1L):i], ...)
242+
tight = function(i, dest, src, n) FUN(src[(i-n[i]+1L):i], ...) # nocov
243243
}
244244
} else {
245245
if (!list.df) {
@@ -250,10 +250,10 @@ frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","
250250
if (has.growable) {
251251
tight = function(i, dest, src, n) FUN(.Call(CmemcpyDTadaptive, dest, src, i, n), ...)
252252
} else {
253-
if (!list.df) {
254-
tight = function(i, dest, src, n) FUN(src[(i-n[i]+1L):i, , drop=FALSE], ...)
253+
if (!list.df) { # nocov
254+
tight = function(i, dest, src, n) FUN(src[(i-n[i]+1L):i, , drop=FALSE], ...) # nocov
255255
} else {
256-
tight = function(i, dest, src, n) FUN(lapply(src, `[`, (i-n[i]+1L):i), ...)
256+
tight = function(i, dest, src, n) FUN(lapply(src, `[`, (i-n[i]+1L):i), ...) # nocov
257257
}
258258
}
259259
}
@@ -299,13 +299,13 @@ frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","
299299
})[["pid"]]
300300
}
301301
} else { ## windows || getDTthreads()==1L
302-
h = list(err=NULL, warn=NULL) ## pretty printing errors/warnings
302+
h = list2env(list(warning=NULL, error=NULL)) ## pretty printing errors/warnings
303303
oldDTthreads = setDTthreads(1L) ## for consistency, anyway window size is unlikely to be big enough to benefit any parallelism
304304
withCallingHandlers(
305305
tryCatch(
306306
thisans <- lapply(ansi, FUN = tight, dest = cpy(w), src = thisx, n = thisn),
307-
error = function(e) h$err <<- conditionMessage(e)
308-
), warning = function(w) {h$warn <<- c(h$warn, conditionMessage(w)); invokeRestart("muffleWarning")}
307+
error = function(e) h$err = conditionMessage(e)
308+
), warning = function(w) {h$warn = c(h$warn, conditionMessage(w)); invokeRestart("muffleWarning")}
309309
)
310310
setDTthreads(oldDTthreads)
311311
if (!is.null(h$warn))

0 commit comments

Comments
 (0)