needless_continue
Finds a continue as the last thing a loop body does.
Category style, warn by default.
#import "Basic";
main :: () {
items := int.[1, 2, 3, 4];
total := 0;
for items {
total += it;
continue;
}
print("%\n", total);
}warning[needless_continue]: this `continue` is the last thing the loop does
--> example.jai:9:9
|
9 | continue;
| ^^^^^^^^^
|
help: remove it
|
9 - continue;
|
= note: `needless_continue` is `warn` by default#import "Basic";
main :: () {
items := int.[1, 2, 3, 4];
total := 0;
for items {
total += it;
}
print("%\n", total);
}An unlabelled continue that ends a for or while body, or ends a branch of an if that is the body's last statement.