[IMP] *: use lower level loops in hot code

The goal is to gain a few % of perf improvement.

closes #125
This commit is contained in:
Géry Debongnie
2019-05-28 14:04:08 +02:00
parent 94208d9cbb
commit bced9f3d04
8 changed files with 166 additions and 122 deletions
+3 -2
View File
@@ -90,10 +90,11 @@ exports[`composition sub widgets with some state rendered in a loop 1`] = `
if (!_2) { throw new Error('QWeb error: Invalid loop expression')}
if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())}
var _3 = _2 instanceof Array ? _2 : Object.keys(_2);
var _length3 = _3.length;
var _4 = _2 instanceof Array ? _2 : Object.values(_2);
for (let i = 0; i < _3.length; i++) {
for (let i = 0; i < _length3; i++) {
context.number_first = i === 0;
context.number_last = i === _3.length - 1;
context.number_last = i === _length3 - 1;
context.number_parity = i % 2 === 0 ? 'even' : 'odd';
context.number_index = i;
context.number = _3[i];