Fix: optimize row removing when i === 0

This commit is contained in:
eight 2018-09-02 14:17:33 +08:00
parent 2fb16529fb
commit 47c6834331

View File

@ -105,8 +105,13 @@ var linterReport = (() => {
tr.update(anno); tr.update(anno);
i++; i++;
} }
while (trs.length > i) { if (i === 0) {
trs.pop().element.remove(); trs.length = 0;
tbody.textContent = '';
} else {
while (trs.length > i) {
trs.pop().element.remove();
}
} }
table.classList.toggle('empty', trs.length === 0); table.classList.toggle('empty', trs.length === 0);