For loop should only create a loop variable if it is used
dirkschumacher opened this issue · comments
Dirk Schumacher commented
x <- 10
for(i in seq_len(10)) {
x <- x + 1
}
Problem is that then a warning is issued that i is not used but declared.
Maybe always directly convert it to:
auto && __range = range_expression ;
for (auto __begin = begin_expr, __end = end_expr; __begin != __end; ++__begin) {
range_declaration = *__begin;
loop_statement
}