powered by
Performs one common subexpression elimination pass. Carefully examine the results after running this function!
opt_common_subexpr(texts, n_values = 2, in_fun_call = FALSE)
A list of character vectors with the code to optimize.
A numeric indicating the minimum number of values to consider a subexpression.
A logical indicating whether it should propagate in function calls. Note: this could change the semantics of the program.
# NOT RUN { code <- paste( "a <- b * c + g", "d = b * c * e", sep = "\n" ) cat(opt_common_subexpr(list(code))$codes[[1]]) # }
Run the code above in your browser using DataLab