From 1b75a6f989ca13302795887424f85176e7f4a391 Mon Sep 17 00:00:00 2001 From: Jim Hester Date: Thu, 20 Apr 2017 09:41:05 -0400 Subject: [PATCH] No need for list_call anymore We evaluate only called arguments (using `match.call()`) and default arguments. --- R/memoise.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/R/memoise.R b/R/memoise.R index fb831f1..1cfd465 100644 --- a/R/memoise.R +++ b/R/memoise.R @@ -107,9 +107,6 @@ memoise <- memoize <- function(f, ..., envir = environment(f), cache = cache_mem f_formal_names <- names(f_formals) f_formal_name_list <- lapply(f_formal_names, as.name) - # list(...) - list_call <- make_call(quote(list), f_formal_name_list) - # memoised_function(...) init_call_args <- setNames(f_formal_name_list, f_formal_names) init_call <- make_call(quote(`_f`), init_call_args) @@ -147,7 +144,7 @@ memoise <- memoize <- function(f, ..., envir = environment(f), cache = cache_mem invisible(res$value) } }, - as.environment(list(list_call = list_call, init_call = init_call))) + as.environment(list(init_call = init_call))) ) formals(memo_f) <- f_formals attr(memo_f, "memoised") <- TRUE