Skip to content

Commit

Permalink
loopcount must be CTC, not only literal number
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Aug 26, 2021
1 parent 830429b commit c9c3dfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/loop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ is equivalently unrolled to
x = x * 2;
Because `loop unrolling <https://en.wikipedia.org/wiki/Loop_unrolling>`_ is done at compile time, the compiler must know ``maxLoopCount``, which has to be a constant number.
Because `loop unrolling <https://en.wikipedia.org/wiki/Loop_unrolling>`_ is done at compile time, the compiler must know ``maxLoopCount``. That is, it must be a :ref:`compile time constant<ctc-label>`.


If ``maxLoopCount`` is set too small, the contract may not work correctly. If ``maxLoopCount`` is set too large, the resulting script is bloated unnecessarily and costs more to execute.
Expand Down

0 comments on commit c9c3dfd

Please sign in to comment.