diff options
author | Cheng-Han, Wu | 2016-06-02 01:06:35 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-06-02 01:06:35 +0800 |
commit | 223d685a7c6ee95213ec2afcecb6d90dcd6b0259 (patch) | |
tree | f9b129bf3b107f352e39a506181fc29fb3c2dda4 /public | |
parent | 7a371ec7ca1e8cd65956f9724823f8e428e6693c (diff) |
Improve history clearDuplicatedHistory performance
Diffstat (limited to '')
-rw-r--r-- | public/js/history.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/public/js/history.js b/public/js/history.js index b3bae980..9bdca709 100644 --- a/public/js/history.js +++ b/public/js/history.js @@ -93,14 +93,8 @@ function clearDuplicatedHistory(notehistory) { for (var i = 0; i < notehistory.length; i++) { var found = false; for (var j = 0; j < newnotehistory.length; j++) { - var id = notehistory[i].id; - var newId = newnotehistory[j].id; - try { - id = LZString.decompressFromBase64(id); - newId = LZString.decompressFromBase64(newId); - } catch (err) { - // na - } + var id = notehistory[i].id.replace(/\=+$/, ''); + var newId = newnotehistory[j].id.replace(/\=+$/, ''); if (id == newId || notehistory[i].id == newnotehistory[j].id || !notehistory[i].id || !newnotehistory[j].id) { var time = moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a'); var newTime = moment(newnotehistory[j].time, 'MMMM Do YYYY, h:mm:ss a'); |