| 6 | } |
| 7 | |
| 8 | void WSITileGraphicsItemCache::evict() { |
| 9 | // Identify least recently used key |
| 10 | std::map<keyType, std::pair<std::pair<WSITileGraphicsItem*, unsigned int>, keyTypeList::iterator> >::iterator it = _cache.find(_LRU.front()); |
| 11 | |
| 12 | // Erase both elements to completely purge record |
| 13 | WSITileGraphicsItem* itemToEvict = it->second.first.first; |
| 14 | _cacheCurrentByteSize -= it->second.first.second; |
| 15 | _cache.erase(it); |
| 16 | _LRU.pop_front(); |
| 17 | emit itemEvicted(itemToEvict); |
| 18 | } |
| 19 | |
| 20 | void WSITileGraphicsItemCache::clear() { |
| 21 | _cache.clear(); |
nothing calls this directly
no outgoing calls
no test coverage detected