Suggest optimizing for/last
expressions
#431
Labels
new lint
Issues suggesting new lints or pull requests implementing new lints
for/last
expressions
#431
The
for/last
form evaluates the loop body every iteration, even though it often only needs to evaluate it on the last iteration. This is very wasteful when the loop body is computing something whose side effects don't matter. Resyntax ought to suggest something to optimize this, either by manually extracting the body out or by using a new keyword we could add tofor/last
that tells it to only evaluate the last loop body.The text was updated successfully, but these errors were encountered: