Don't apply updateSort if the sort hasn't changed

This commit is contained in:
Rob Garrison 2017-12-23 17:54:09 -06:00
parent cbbd583868
commit f083b97f32

View File

@ -153,8 +153,8 @@ function manageSort(event) {
function updateSort() { function updateSort() {
const renderBin = document.createDocumentFragment(); const renderBin = document.createDocumentFragment();
const entries = sortStyles({parser: 'entry'}); const entries = sortStyles({parser: 'entry'});
const isDiffSort = [...installed.children].find((entry, index) => entry.id !== entries[index].id);
let index = 0; let index = 0;
moveEntries();
function moveEntries() { function moveEntries() {
const t0 = performance.now(); const t0 = performance.now();
let moved = 0; let moved = 0;
@ -169,7 +169,10 @@ function updateSort() {
return; return;
} }
} }
installed.appendChild(renderBin); if (isDiffSort !== undefined) {
moveEntries();
installed.appendChild(renderBin);
}
updateStripes(); updateStripes();
} }