From 4ae7c8e5a34752efc1ca93019519be8c47e12916 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Fri, 27 Sep 2024 14:33:22 -0700 Subject: [PATCH] some more tidying up --- R/call.R | 11 ++++------- R/dependencies.R | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/R/call.R b/R/call.R index c074d048b..1b0b4d7ed 100644 --- a/R/call.R +++ b/R/call.R @@ -67,13 +67,10 @@ renv_call_matches <- function(call, names, nargs = NULL) { ok <- FALSE - if (is.call(call)) { - if (is.symbol(sym <- call[[1L]])) { - if (any(names == as.character(sym))) { - ok <- is.null(nargs) || length(call) == nargs + 1L - } - } - } + if (is.call(call) && + is.symbol(sym <- call[[1L]]) && + any(names == as.character(sym))) + ok <- is.null(nargs) || length(call) == nargs + 1L ok diff --git a/R/dependencies.R b/R/dependencies.R index 32c6da04e..8d32c1252 100644 --- a/R/dependencies.R +++ b/R/dependencies.R @@ -1898,7 +1898,7 @@ renv_dependencies_recurse_impl <- function(stack, object, callback, ...) { # recurse if (is.recursive(object)) for (i in seq_along(object)) - if (!is.symbol(object[[i]])) + if (is.call(object[[i]])) renv_dependencies_recurse_impl(stack, object[[i]], callback, ...) }