Skip to content

Commit

Permalink
reorder assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Feb 5, 2024
1 parent f0f6197 commit a788931
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/crew_controller.R
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ crew_class_controller <- R6::R6Class(
throttle = TRUE,
controller = NULL
) {
crew_assert(
length(private$.tasks) < 1L,
message = "cannot map() until all prior tasks are completed and popped"
)
crew_assert(substitute, isTRUE(.) || isFALSE(.))
if (substitute) {
command <- substitute(command)
Expand Down Expand Up @@ -655,10 +659,6 @@ crew_class_controller <- R6::R6Class(
error %in% c("stop", "warn", "silent"),
message = "'error' argument must be \"stop\", \"warn\", or \"silent\""
)
crew_assert(
length(private$.tasks) < 1L,
message = "cannot map() until all prior tasks are completed and popped"
)
crew_assert(scale, isTRUE(.) || isFALSE(.))
crew_assert(throttle, isTRUE(.) || isFALSE(.))
string <- if_any(save_command, deparse_safe(command), NA_character_)
Expand Down

0 comments on commit a788931

Please sign in to comment.