Skip to content

Commit

Permalink
Minimise further
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Sep 16, 2024
1 parent 44f00af commit 12717d7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions R/profvis.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ profvis <- function(expr = NULL,
on.exit(unlink(prof_output), add = TRUE)
}

# Use unique name so we can easily find in trim_suffix()
# Use unique name so we can easily trim below
`__profvis_execute__` <- new_function(list(), expr_q, env)

repeat {
Expand All @@ -189,7 +189,7 @@ profvis <- function(expr = NULL,
}
}

lines <- trim_suffix(lines)
lines <- gsub('"__profvis_execute__".*$', "", lines)
} else {
# If we got here, we were provided a prof_input file instead of expr
expr_source <- NULL
Expand Down Expand Up @@ -248,10 +248,6 @@ with_profvis_handlers <- function(expr) {
})
}

trim_suffix <- function(lines) {
gsub('"__profvis_execute__".*$', "", lines)
}

#' Print a profvis object
#'
#' @inheritParams profvis
Expand Down

0 comments on commit 12717d7

Please sign in to comment.