opt_dead_expr: Optimizer: Dead Expression Elimination.

View source: R/opt-dead-expr.R

opt_dead_exprR Documentation

Optimizer: Dead Expression Elimination.

Description

Performs one dead expression elimination pass. Carefully examine the results after running this function!

Usage

opt_dead_expr(texts)

Arguments

texts

A list of character vectors with the code to optimize.

Examples

code <- paste(
  "foo <- function(x) {",
  "  x ^ 3",
  "  return(x ^ 3)",
  "}",
  sep = "\n"
)
cat(opt_dead_expr(list(code))$codes[[1]])

jcrodriguez1989/rco documentation built on Nov. 12, 2024, 12:23 p.m.