removeEntry method

void removeEntry(
  1. Object key,
  2. EvictionReason reason
)

Internal remove method with eviction reason.

Implementation

void removeEntry(Object key, EvictionReason reason) {
  final entry = _entries.remove(key);
  if (entry != null) {
    // Update size
    if (entry.size != null) {
      _currentSize -= entry.size!;
    }

    // Detach listeners
    entry
      ..detach()

      // Invoke callbacks
      ..invokeEvictionCallbacks(reason);
  }
}