Skip to content

Commit f71f327

Browse files
BUG FIX: Work around pbmcapply::progressBar(min=0, max=0) not being supported (#108)
1 parent aaaf579 commit f71f327

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

R/handler_pbmcapply.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,18 @@ handler_pbmcapply <- function(substyle = 3L, style = "ETA", file = stderr(), int
7070

7171
pb <- NULL
7272

73-
make_pb <- function(...) {
73+
make_pb <- function(max, ...) {
7474
if (!is.null(pb)) return(pb)
75-
args <- c(list(...), backend_args)
76-
pb <<- do.call(progressBar, args = args)
75+
76+
## SPECIAL CASE: pbmcapply::progressBar() does not support max == min
77+
##
78+
if (max == 0) {
79+
pb <<- voidProgressBar()
80+
} else {
81+
args <- c(list(...), backend_args)
82+
pb <<- do.call(progressBar, args = args)
83+
}
84+
7785
pb
7886
}
7987

0 commit comments

Comments
 (0)