selectEntry method Null safety

  1. @override
bool selectEntry(
  1. CacheInfo entry,
  2. CacheInfo selectedEntry,
  3. DateTime now
)

Returns true if entry is a better candidate for eviction than the current selectedEntry

  • entry: The current entry
  • selectedEntry: The current selected entry
  • now: The current time

Implementation

@override
bool selectEntry(CacheInfo entry, CacheInfo selectedEntry, DateTime now) {
  return entry.creationTime.isBefore(selectedEntry.creationTime);
}