remove method
removes the entry at position key. Returns the entry or null. Note that the entry is already evicted.
Implementation
@override
CacheEntry<K, V>? remove(K key) {
CacheEntry<K, V>? oldEntry = _internalMap.remove(key);
if (oldEntry != null && oldEntry.value != null) {
if (onEvict != null) onEvict!(oldEntry.key, oldEntry.value!);
return oldEntry;
}
oldEntry = _weakMap.target?.remove(key);
if (oldEntry != null && oldEntry.value != null) {
if (onEvict != null) onEvict!(oldEntry.key, oldEntry.value!);
return oldEntry;
}
return oldEntry;
}