Skip to content

Commit 223d685

Browse files
committed
Improve history clearDuplicatedHistory performance
1 parent 7a371ec commit 223d685

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

public/js/history.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,8 @@ function clearDuplicatedHistory(notehistory) {
9393
for (var i = 0; i < notehistory.length; i++) {
9494
var found = false;
9595
for (var j = 0; j < newnotehistory.length; j++) {
96-
var id = notehistory[i].id;
97-
var newId = newnotehistory[j].id;
98-
try {
99-
id = LZString.decompressFromBase64(id);
100-
newId = LZString.decompressFromBase64(newId);
101-
} catch (err) {
102-
// na
103-
}
96+
var id = notehistory[i].id.replace(/\=+$/, '');
97+
var newId = newnotehistory[j].id.replace(/\=+$/, '');
10498
if (id == newId || notehistory[i].id == newnotehistory[j].id || !notehistory[i].id || !newnotehistory[j].id) {
10599
var time = moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a');
106100
var newTime = moment(newnotehistory[j].time, 'MMMM Do YYYY, h:mm:ss a');

0 commit comments

Comments
 (0)