Skip to content

Commit

Permalink
futile perf tweak on analysis and round movelists
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 9, 2015
1 parent 8695073 commit 34efe0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions ui/analyse/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,11 @@ function renderTree(ctrl, tree) {
}

var path = treePath.default();
return turns.map(function(turn) {
return renderTurn(ctrl, turn, path);
});
var tags = [];
for (var i = 0, len = turns.length; i < len; i++)
tags.push(renderTurn(ctrl, turns[i], path));

return tags;
}

function renderAnalyse(ctrl) {
Expand Down
14 changes: 8 additions & 6 deletions ui/round/src/view/replay.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ function renderTable(ctrl) {
for (var i = 2, len = steps.length; i < len; i += 2) pairs.push([steps[i], steps[i + 1]]);
}

var trs = pairs.map(function(pair, i) {
return m('tr', [
var trs = [];
for (var i = 0, len = pairs.length; i < len; i++)
trs.push(m('tr', [
m('td.index', i + 1),
renderTd(pair[0], ctrl.vm.ply),
renderTd(pair[1], ctrl.vm.ply)
]);
}).concat(renderResult(ctrl, true));
renderTd(pairs[i][0], ctrl.vm.ply),
renderTd(pairs[i][1], ctrl.vm.ply)
]));
trs.push(renderResult(ctrl, true));

return m('table',
m('tbody', {
onclick: function(e) {
Expand Down

0 comments on commit 34efe0b

Please sign in to comment.