Changeset 31611 in osm for applications
- Timestamp:
- 2015-10-11T23:52:47+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
r31609 r31611 52 52 public synchronized void addTile(Tile tile) { 53 53 CacheEntry entry = createCacheEntry(tile); 54 hash.put(tile.getKey(), entry); 55 lruTiles.addFirst(entry); 56 if (hash.size() > cacheSize || lruTiles.getElementCount() > cacheSize) { 57 removeOldEntries(); 54 if (hash.put(tile.getKey(), entry) == null) { 55 // only if hash hadn't had the element, add it to LRU 56 lruTiles.addFirst(entry); 57 if (hash.size() > cacheSize || lruTiles.getElementCount() > cacheSize) { 58 removeOldEntries(); 59 } 58 60 } 59 61 }
Note:
See TracChangeset
for help on using the changeset viewer.