diff --git a/R/active.R b/R/active.R index e54f893d8..801980226 100644 --- a/R/active.R +++ b/R/active.R @@ -7,7 +7,7 @@ find_active_file <- function(arg = "file", call = parent.frame()) { find_test_file <- function(path, call = parent.frame()) { type <- test_file_type(path) - if (any(is.na(type))) { + if (anyNA(type)) { file <- path_file(path[is.na(type)]) cli::cli_abort( "Don't know how to find tests associated with the active file {.file {file}}", diff --git a/R/check-devtools.R b/R/check-devtools.R index 96727b00e..26afafa0a 100644 --- a/R/check-devtools.R +++ b/R/check-devtools.R @@ -28,10 +28,10 @@ check_dev_versions <- function(pkg = ".") { parsed <- lapply(deps$version, function(x) unlist(numeric_version(x))) - lengths <- vapply(parsed, length, integer(1)) + lens <- lengths(parsed) last_ver <- vapply(parsed, function(x) x[[length(x)]], integer(1)) - is_dev <- lengths == 4 & last_ver >= 9000 + is_dev <- lens == 4 & last_ver >= 9000 check_status( !any(is_dev), diff --git a/R/utils.R b/R/utils.R index 48629a0e6..864c1683c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,6 +1,5 @@ compact <- function(x) { - is_empty <- vapply(x, function(x) length(x) == 0, logical(1)) - x[!is_empty] + x[lengths(x) > 0] } "%||%" <- function(a, b) if (!is.null(a)) a else b