MapCache<K, V>.lru constructor

MapCache<K, V>.lru({
  1. int? maximumSize,
})

Creates a new MapCache, using LruMap as the backing Map.

When maximumSize is specified, the cache is limited to the specified number of pairs, otherwise it is limited to 100.

Implementation

factory MapCache.lru({int? maximumSize}) {
  // TODO(cbracken): inline the default value here for readability.
  // https://github.com/google/quiver-dart/issues/653
  return MapCache<K, V>(map: LruMap(maximumSize: maximumSize));
}