From b53ac84d0dec2a1626383c583c8344bba546446a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20M=C3=BCcke?= Date: Fri, 24 Jan 2025 16:35:48 +0100 Subject: [PATCH] Faster standalone compact (#1773) --- R/standalone-purrr.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/standalone-purrr.R b/R/standalone-purrr.R index 9cb36e941..fde7ad977 100644 --- a/R/standalone-purrr.R +++ b/R/standalone-purrr.R @@ -129,7 +129,7 @@ map_if <- function(.x, .p, .f, ...) { } compact <- function(.x) { - Filter(length, .x) + .x[as.logical(lengths(.x))] } transpose <- function(.l) {