Skip to content

Commit 5462a20

Browse files
Fix: look up another level, use %iscall%
1 parent f7be165 commit 5462a20

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

R/cedta.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ cedta.pkgEvalsUserCode = c("gWidgetsWWW","statET","FastRWeb","slidify","rmarkdow
3131
.any_eval_calls_in_stack = function(calls) {
3232
# likelier to be close to the end of the call stack, right?
3333
for (ii in length(calls):1) { # nolint: seq_linter. rev(seq_len(length(calls)))? See https://bugs.r-project.org/show_bug.cgi?id=18406.
34-
the_call = calls[[ii]][[1L]]
35-
if (is.name(the_call) && (the_call %chin% c("eval", "evalq"))) return(TRUE)
34+
if (calls[[ii]] %iscall% c("eval", "evalq")) return(TRUE)
3635
}
3736
FALSE
3837
}
3938
# nocov end
4039

4140
.any_sd_queries_in_stack = function(calls) {
4241
for (ii in length(calls):1) { # nolint: seq_linter. As above.
43-
the_call = calls[[ii]][1L]
44-
if (!is.name(the_call) || the_call != "[") next
42+
if (!calls[[ii]] %iscall% "[") next
4543
the_lhs = calls[[ii]][[2L]]
4644
if (!is.name(the_lhs) || the_lhs != ".SD") next
4745
return(TRUE)
@@ -95,7 +93,7 @@ cedta = function(n=2L) {
9593
return(env$.datatable.aware)
9694
}
9795
ns = topenv(env)
98-
ans = .cedta_impl_(ns, n)
96+
ans = .cedta_impl_(ns, n+1L)
9997
if (!ans && getOption("datatable.verbose")) {
10098
# nocov start
10199
catf("cedta decided '%s' wasn't data.table aware. Here is call stack with [[1L]] applied:\n", getNamespaceName(ns))

0 commit comments

Comments
 (0)