mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 17:29:50 +08:00
NoteCache: Avoid duplicates
This should ideally never happen, but it seems to be occasionally happening for some reason.
This commit is contained in:
@ -85,7 +85,9 @@ class NotesCache {
|
||||
var heap = HeapPriorityQueue<Note>(reversedFn);
|
||||
|
||||
for (var note in allNotes) {
|
||||
heap.add(note);
|
||||
if (!heap.contains(note)) {
|
||||
heap.add(note);
|
||||
}
|
||||
if (heap.length > CACHE_SIZE) {
|
||||
heap.removeFirst();
|
||||
}
|
||||
|
Reference in New Issue
Block a user