NotesCache: Increase its size to 20

With the cards view, we see way more notes.
This commit is contained in:
Vishesh Handa
2020-04-04 10:35:38 +02:00
parent 0524ce665f
commit 4c73840d43

View File

@ -16,6 +16,8 @@ class NotesCache {
final String notesBasePath; final String notesBasePath;
final bool enabled = true; final bool enabled = true;
static const CACHE_SIZE = 20;
NotesCache({@required this.filePath, @required this.notesBasePath}); NotesCache({@required this.filePath, @required this.notesBasePath});
Future load(NotesFolderFS rootFolder) async { Future load(NotesFolderFS rootFolder) async {
@ -84,7 +86,7 @@ class NotesCache {
for (var note in allNotes) { for (var note in allNotes) {
heap.add(note); heap.add(note);
if (heap.length > 10) { if (heap.length > CACHE_SIZE) {
heap.removeFirst(); heap.removeFirst();
} }
} }