diff --git a/docs/internals/optimizer.rst b/docs/internals/optimizer.rst index eb246c939f08..498a15567848 100644 --- a/docs/internals/optimizer.rst +++ b/docs/internals/optimizer.rst @@ -1427,14 +1427,14 @@ The condition and the fact that the counter variable is only ever incremented guarantee that it never overflows. The precise requirements for the loop to be eligible for the optimization are as follows: - - The loop condition is a comparison of the form ``i < Y``, for a local counter variable ``i`` and an expression ``Y``. - - The built-in operator ``<`` is necessarily used in the loop condition. User-defined operators are **not** eligible. - - The loop expression is a prefix or postfix increment of the counter variable, i.e, ``i++`` or ``++i``. - - The loop counter is a local declared variable of a built-in integer type. - - The loop counter is **not** modified by the loop body or by the expression used as the loop condition. - - The comparison is performed on the same type as the loop counter, meaning that the type of the - right-hand-side expression is implicitly convertible to the type of the counter, such that the latter - is not implicitly widened before comparing. +- The loop condition is a comparison of the form ``i < Y``, for a local counter variable ``i`` and an expression ``Y``. +- The built-in operator ``<`` is necessarily used in the loop condition. User-defined operators are **not** eligible. +- The loop expression is a prefix or postfix increment of the counter variable, i.e, ``i++`` or ``++i``. +- The loop counter is a local declared variable of a built-in integer type. +- The loop counter is **not** modified by the loop body or by the expression used as the loop condition. +- The comparison is performed on the same type as the loop counter, meaning that the type of the + right-hand-side expression is implicitly convertible to the type of the counter, such that the latter + is not implicitly widened before comparing. To clarify the last condition, consider the following example: