rspec/rules/S888/exceptions.adoc
Alban Auzeill 2c306d110e Fix code block ambiguity with old header style
Ensure blank line before list and clean the one leading space
2020-06-30 17:16:12 +02:00

19 lines
475 B
Plaintext

== Exceptions
Equality operators are ignored if the loop counter is not modified within the body of the loop and either:
* starts below the ending value and is incremented by 1 on each iteration.
* starts above the ending value and is decremented by 1 on each iteration.
Equality operators are also ignored when the test is against <code>null</code>.
----
for (int i = 0; arr[i] != null; i++) {
// ...
}
for (int i = 0; (item = arr[i]) != null; i++) {
// ...
}
----