Skip to content

Commit

Permalink
Refactor: simplify .execute in ProgressTrackingContext
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaiconstantin committed Apr 30, 2023
1 parent ce9b15a commit 3183e83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/ProgressTrackingContext.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ ProgressTrackingContext <- R6::R6Class("ProgressTrackingContext",
unlink(log)
})

# Decorate task function and save it as `task` (i.e., for readability).
task <- private$.decorate(task = fun, log = log)
# Decorate the task function.
fun <- private$.decorate(task = fun, log = log)

# Substitute `fun` with `task` (i.e., for readability) and evaluate.
eval(substituteDirect(operation, list(fun = task)))
# Evaluate the operation now referencing the decorated task.
eval(operation)

# Show the progress bar and block the main process.
private$.show_progress(total = length(x), log = log)
Expand Down

0 comments on commit 3183e83

Please sign in to comment.