Bläddra i källkod

Reduce the cache size

Vishnu Mohandas 5 år sedan
förälder
incheckning
5639f3739a
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      lib/core/cache/image_cache.dart
  2. 1 1
      lib/core/cache/thumbnail_cache.dart

+ 1 - 1
lib/core/cache/image_cache.dart

@@ -4,7 +4,7 @@ import 'package:photos/core/cache/lru_map.dart';
 import 'package:photos/models/photo.dart';
 
 class ImageLruCache {
-  static LRUMap<int, File> _map = LRUMap(500);
+  static LRUMap<int, File> _map = LRUMap(25);
 
   static File get(Photo photo) {
     return _map.get(photo.hashCode);

+ 1 - 1
lib/core/cache/thumbnail_cache.dart

@@ -4,7 +4,7 @@ import 'package:photos/core/cache/lru_map.dart';
 import 'package:photos/models/photo.dart';
 
 class ThumbnailLruCache {
-  static LRUMap<_ThumbnailCacheKey, Uint8List> _map = LRUMap(5000);
+  static LRUMap<_ThumbnailCacheKey, Uint8List> _map = LRUMap(1000);
 
   static Uint8List get(Photo photo, int size) {
     return _map.get(_ThumbnailCacheKey(photo, size));