jackfirth / resyntax

A Racket refactoring engine
Apache License 2.0
56 stars 10 forks source link

Suggest inlining immediately-returned variables #158

Closed jackfirth closed 1 week ago

jackfirth commented 2 years ago

Saw this code today:

 (λ ()
   (define t (get-token-grammar i))
   t)

The t variable is immediately returned and therefore useless. This can be refactored to just: (λ () (get-token-grammar i)).