Skip to content

Commit 60e355c

Browse files
committed
Faster singleton detection
1 parent 31c3959 commit 60e355c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/tags.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ rewriteTags <- function(ui, func, preorder) {
335335
# different).
336336
surroundSingletons <- local({
337337
surroundSingleton <- function(uiObj) {
338-
if (is(uiObj, "shiny.singleton")) {
338+
if (inherits(uiObj, "shiny.singleton")) {
339339
sig <- digest(uiObj, "sha1")
340340
class(uiObj) <- class(uiObj)[class(uiObj) != "shiny.singleton"]
341341
return(tagList(
@@ -358,7 +358,7 @@ surroundSingletons <- local({
358358
# HTML objects and also the list of known singletons.
359359
takeSingletons <- function(ui, singletons=character(0), desingleton=TRUE) {
360360
result <- rewriteTags(ui, function(uiObj) {
361-
if (is(uiObj, "shiny.singleton")) {
361+
if (inherits(uiObj, "shiny.singleton")) {
362362
sig <- digest(uiObj, "sha1")
363363
if (sig %in% singletons)
364364
return(NULL)

0 commit comments

Comments
 (0)