Skip to content

Commit

Permalink
merge upstream speedups (#1072, #1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Feb 26, 2024
2 parents 9b54931 + 5491946 commit dc6b120
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 5 additions & 2 deletions R/fit_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ form_form <-
if (inherits(env$data, "data.frame")) {
check_outcome(eval_tidy(rlang::f_lhs(env$formula), env$data), object)

encoding_info <- get_encoding(class(object)[1])
encoding_info <-
get_encoding(class(object)[1]) %>%
dplyr::filter(mode == object$mode, engine == object$engine)
vctrs::vec_slice(
encoding_info,
encoding_info$mode == object$mode & encoding_info$engine == object$engine
)

remove_intercept <- encoding_info %>% dplyr::pull(remove_intercept)
if (remove_intercept) {
Expand Down
2 changes: 0 additions & 2 deletions R/translate.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ translate.default <- function(x, engine = x$engine, ...) {

get_model_spec <- function(model, mode, engine) {
m_env <- get_model_env()
env_obj <- rlang::env_names(m_env)
env_obj <- grep(model, env_obj, value = TRUE)

res <- list()

Expand Down

0 comments on commit dc6b120

Please sign in to comment.