Skip to content

Commit b53ac84

Browse files
authored
Faster standalone compact (#1773)
1 parent fa4fcbd commit b53ac84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/standalone-purrr.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ map_if <- function(.x, .p, .f, ...) {
129129
}
130130

131131
compact <- function(.x) {
132-
Filter(length, .x)
132+
.x[as.logical(lengths(.x))]
133133
}
134134

135135
transpose <- function(.l) {

0 commit comments

Comments
 (0)