Closed albb0920 closed 5 years ago
Hi
When using the each loop, the expression part is evaluate upon each iteration. This could be problematic if the expression's output changes each time, or if the expression is expensive to compute.
each
This patch saves the expression's result in a temporary variable, just like the official implementation. https://github.com/pugjs/pug/blob/pug%402.0.3/packages/pug-code-gen/index.js#L731
Thank you!
Hi
When using the
each
loop, the expression part is evaluate upon each iteration. This could be problematic if the expression's output changes each time, or if the expression is expensive to compute.This patch saves the expression's result in a temporary variable, just like the official implementation. https://github.com/pugjs/pug/blob/pug%402.0.3/packages/pug-code-gen/index.js#L731
Thank you!