From 2384e2c4cd9952ee9fd23df3c48368e2e4f1ec0c Mon Sep 17 00:00:00 2001 From: simonpcouch Date: Fri, 14 Jul 2023 11:02:36 -0500 Subject: [PATCH] return early when possible in `check_for_unknowns()` --- R/aaa_unknown.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/aaa_unknown.R b/R/aaa_unknown.R index ef408c29..0d8d89b1 100644 --- a/R/aaa_unknown.R +++ b/R/aaa_unknown.R @@ -82,6 +82,9 @@ has_unknowns_val <- function(object) { check_for_unknowns <- function(x, ..., call = caller_env()) { check_dots_empty() + if (is.atomic(x)) { + return(invisible(TRUE)) + } if (length(x) == 1 && is_unknown(x)) { rlang::abort("Unknowns not allowed.", call = call) }