opt_dead_expr: Optimizer: Dead Expression Elimination.

Description Usage Arguments Examples

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

Description

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

Usage

1

Arguments

texts

A list of character vectors with the code to optimize.

Examples

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

rco documentation built on April 17, 2021, 5:06 p.m.