Skip to content

Commit 8add9f7

Browse files
committed
Restructure logic and simplify
1 parent 9ce9c5e commit 8add9f7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

R/tags.R

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,10 @@ rewriteTags <- function(ui, func, preorder) {
296296
if (preorder)
297297
ui <- func(ui)
298298

299-
if (!isTag(ui) && is.list(ui)) {
300-
if (length(ui) > 0) {
301-
ui[] <- lapply(ui, rewriteTags, func, preorder)
302-
}
303-
} else if (isTag(ui)) {
304-
if (length(ui$children) > 0) {
305-
ui$children[] <- lapply(ui$children, rewriteTags, func, preorder)
306-
}
299+
if (isTag(ui)) {
300+
ui$children[] <- lapply(ui$children, rewriteTags, func, preorder)
301+
} else if (is.list(ui)) {
302+
ui[] <- lapply(ui, rewriteTags, func, preorder)
307303
}
308304

309305
if (!preorder)

0 commit comments

Comments
 (0)