diff --git a/R/programming.R b/R/programming.R index c82fb3681..e12ddbc3a 100644 --- a/R/programming.R +++ b/R/programming.R @@ -14,8 +14,8 @@ list2lang = function(x) { stopf("'x' must be a list") if (is.AsIs(x)) return(rm.AsIs(x)) - asis = vapply(x, is.AsIs, FALSE) - char = vapply(x, is.character, FALSE) + asis = vapply_1b(x, is.AsIs) + char = vapply_1b(x, is.character) to.name = !asis & char if (any(to.name)) { ## turns "my_name" character scalar into `my_name` symbol, for convenience if (any(non.scalar.char <- lengths(x[to.name])!=1L)) { @@ -24,7 +24,7 @@ list2lang = function(x) { x[to.name] = lapply(x[to.name], as.name) } if (isTRUE(getOption("datatable.enlist", TRUE))) { ## recursively enlist for nested lists, see note section in substitute2 manual - islt = vapply(x, only.list, FALSE) #5057 nested DT that inherits from a list must not be turned into list call + islt = vapply_1b(x, only.list) #5057 nested DT that inherits from a list must not be turned into list call to.enlist = !asis & islt if (any(to.enlist)) { x[to.enlist] = lapply(x[to.enlist], enlist) diff --git a/src/programming.c b/src/programming.c index bc059230f..2d6b18586 100644 --- a/src/programming.c +++ b/src/programming.c @@ -1,29 +1,29 @@ #include "data.table.h" static void substitute_call_arg_names(SEXP expr, SEXP env) { - R_len_t len = length(expr); - if (len && isLanguage(expr)) { // isLanguage is R's is.call - SEXP arg_names = getAttrib(expr, R_NamesSymbol); - if (!isNull(arg_names)) { - SEXP env_names = getAttrib(env, R_NamesSymbol); - int *imatches = INTEGER(PROTECT(chmatch(arg_names, env_names, 0))); - const SEXP *env_sub = SEXPPTR_RO(env); - SEXP tmp = expr; - for (int i=0; i